Satissh S
Youngling
Master Linux Command Reference
Ok, You've installed linux, Gr8! Here is a free cookie.
But learning and using linux will be meaningfull with the knowledge of the following ESSENTIAL *nix commands and their PRACTICAL applications.IMHO Here are a few commands which we'll be using typically for routine work as well as system administration of linux. Of course this guide is meant to be no where near comprehensive that's why i request our friends to add new commands which they think will be ESSENTIAL and USEFUL. Thanks a lot!
Addendums
Addendum 1: bash cheatsheet
Addendum 2: copypasting within terminal
Now to the command reference,
1 . Mount :
Mount command is used to mount a filesystem. To mount a FS we use the mount command followed by mount point or device file name as shown here,
the syntax is,
1.
This commands mounts the device with a pre-defined mount point of /mnt/cdrom in FSTAB(/etc/fstab) which is the cdrom drive /dev/hdc or /dev/cdroms/cdrom0 which is a symlink to /dev/hdc by the way.
2.
This command mounts the device /dev/hdc in /mnt/cdrom. The device needs to be specified if it's not pre-defined in FSTAB.
Popular Parametres:-
a. -t
One of the most important param to mount command is -t which specifies the filesystem type,
For example, if one wants to mount a ntfs FS
This command mount the ntfs partition /dev/hda1 in /mnt/win_c
You can specify different FS's such as reiserfs, fat32 etc along with -t . Msdos formatted floppies use 'msdos' filesystem. if you are unsure abt the partition use '-t auto' to try making the shell guess the mount point.
b. -r
The -r param helps you to mount stuff in a read-only filesystem or mount stuff as readonly.
c. -w
The -w param helps to mount the filesystem with write option. Special case for us is that knoppix livecd usually mounts the hdd's partitions as readonly as default. You use this option to mount partitons using write permission just in case you need to trouble shoot a boot loader config.
d. -o loop
The -o loop option parametre is used to mount ISO disk images to another directory and view the contents of the ISO.
For example you want to view the contents of a D/L'ed ISO
2. Umount :
The umount command helps to unmount filesystems. You can invoke this with,
Popular Parametres:-
a. -f
This -f parametre forcefully umounts a network filesystem or an unreachable filesystem.
b. -l
Force unmount the filesystem. We especially use this command when we come out of a chrooted partition and wan't to unmount that filesystem,(IME usual problem with knoppix) it would be busy. We can use lsof command to check which programs are accesing the filesystem and unmount it.
3. fdformat :
This command performs a low-level floppy disk format
4. mkfs :
Using the mkfs command you can create any supported filesystem on an accesible diskvolume. This is high-level formatting and data lost is lost forever.
For example, if we wan't to create a windows boot floppy quickly, all you have to do is
This command is also used to create filesystems on large partitions
where /dev/hda3 being the targeted partition. There is another way to do the above however,
does the same job as well.
5. cp :
As the name suggests, copies files from here to there.
copies the file bzimage from one folder to another.
Popular parametres:-
a. -a
The -a parametre is used to archive a directory to another location, maybe as a backup also i saves file permissions and symbolic links status. Used for backing up file WITH permissions, so that you can replace if something gets screwed up.
b. -b
Ths -b param instructs the cp to make backup of any file with the same name in the destination directory as the copyied file so that the command doesn't explicitly ask you to what to do.
c. -f
This param instructs the command to forcefully replace any exixting file with the same name as the copyied file.
d. -r
Copies files and folders again and again recursively.
e. -i
Asks for confirmation b4 replacing any existing file.
6. mv :
As the name suggests moves files from here to there and as the name doesn't suggest it also renames files.
The parametres for cp also apply to mv.
7. rm :
This command coressponds to delete
for directories however,
A similar command is rmdir
Always re-check a rm command because a file rm'ed is pretty much deleted. The params of cp and mv also applies to rm.
8. ln :
There are two types of links, hardlinks and symbolic links. Hardlinks refer to link for the same file with two or more directory entry. That is say a file called file1 resides at /home/user and we create a link for this file1 to /home/user/files/file1 then the file resides on both and is deleted only when both the references are deleted. Symbolic links are softlinks that refer to the file, like a pointer from another location. We can use ln or cp command to create hard as well as symbolic links. We use
cp -l to create hard links and cp -s to create symbolic links. However my favourite method is ln.
Application:
If you get hold of software binaries, you can simply copy the directory to a conventional location, say for azureus to /opt and create a symlink pointing to /usr/bin so that you need not cd into the azureus directory and start it with ./azureus.
Now you can type azureus in run dialog to run azureus.
9. ls :
Using ls to view the file contents is one of the fun parts of linux, practically when ls is combined with switches and sequences you don't even need a graphical file manager.
The following ls command is used to view the contents of the folder with permissions.
use ls with ordinarily to view the folder contents is quite efficien for small folders but when you want to view the particular files starting with x we add the following sequence.
this command will list all the files in /etc/X11/ directory starting with 'x'.
Using [tab] autocompletion along with these neat tricks makes bash one of the most favourite shells for users.
10 cd :
Change into a directory from another directory.
changes the current working directory to /usr/local.
you can use pwd to view the current working directory.
11 mkdir :
Create a new directory within the current directory or another directory anywhere else.
12 chmod :
Change the permissions to files or directories.
To check permissions of a 'new' directory you can use the following command
this specifies the permissions as
{file-type} {owner} {group} {others}
<directory><read-write-execute> <read-xxx-execute> <read-xxx-execute>
to change em'
Permissions cheat sheet:
There are several numbers denoting file permissions as modes. The popular is 700 which gives full access to the owner.
Popular Parametres:
A most used parametre is -r to recursively change permissions to direcotries and files within them. for example,
changes permissions to all files and folders within new to 700
13. chown :
Change the ownership to files or directories
to change the owner for a 'new' file or folder to a new owner.
changes the ownership of new to user1.
Normally we use the this command recursively with -r option to change recursively the ownership of directories.
A similar command is chgrp which changes the group similarly.
14. df -h :
The df command is used to view info abt all mounted partitions.
Use df -h to find the used and free space of your hard disk volumes.
It will display as output, like for example
15. pciutils :
Pciutils are a set of utils to make the life of a *Nix system admin easier
1. lspci:
View your pci devices. This displays all the devices connected via pci. Normally we either use grep to search the output and display the ones we want.
For example,
similarly,
Or, you can pipe the entire thing view it using more or less, or you can save it as a log and view using your editor.
2. lsmod :
Displays the loaded modules,
You can pipe them out similarly.
3. lsusb :
Displays the CONNECTED usb devices.
4. lsof :
This program displays informations on open files, used devices etc.,
Use this command to see if a umount fails with device busy quote.
5. dmesg :
Displays the kernel output messages while boot time.
The same can be used with | or >> to save.
16. du :
The du command displays the disk usage by partition by partition basis. For example,
Don't use this command without this --max-depth=n option or you'll find your self having to wait a while This option limits du to n directory depth.
For example,
Again you can pipe out the output if you can view it in the terminal.
17. stat :
This command displays information about files like ls -ld with permissions, ownership etc.,
But with several other tasty stuff.
18. uptime :
This command returns the uptime of the system. useful for knowing uptime of servers.
19. free :
This command lists the memory usage of the system.
20. who and finger :
the commands who and finger provide information abt users logged in to the system.
As you can see finger provides some additional information.
21. top :
This is such an essential command which is very hard to ignore. This is more of a utility than a command
Notice the command line, there we execute severel commands for working with processes.
As you can see x consumes a lot of memory and is displayed in the top.
Commands:
Top Cheat sheet:
22. Process manipulation :
ps and pstree commands are used to deal with processes. ps outputs processes info and pstree outputs tree like info structure.
1. ps
2. pstree
as you can see pstree displays the initiated process with the root process, all providing us tasty info.
3. nice and renice
nice and renice commands are used to start a process and set process with different priorities.
renice
the above command changes the priority of process with ID nnnnn to -2. giving it precedence over others.
4. kill
This kill command is used to kill a process with a -s signal and process id.
23. grep :
Search and limit output using grep
The grep command is used to search and limit the output, like we did when using lspci utilities.
For example, if you want to view screen information for your screens in XORG.Conf(/etc/X11/xorg.conf)
24. slocate :
Use this security enhanced version of locate to get files and folders info.
First you need to create a directory index
This wud take sometime to finish.
then search for files
For example,
25. echo :
The command echo is used to print stuff in the standard output.
for example,
However, its most useful use is you can redirect it to file.
for example,
The above commands add the line GENTOO_MIRRORS="*mirror.phy.olemiss.edu/mirror/gentoo" to /etc/make.conf.
But watchout though! i ended up totally cleaning my /etc/make.conf by using >param which deletes the contents of the file and adds the echoed stuff. So always make sure you use >> .
So that ends things up., but let this thread be used by all of us to add the commands that we think will be useful for a new linux user to learn and implement. Lets start linuxing, shall we?
Credits :
1. Linus, RMS and friends for creating this awesome OS.
2. All programmers, coders and hackers.
3. Esr and friends of 'OpenSource' movement.
4. All MAN page and document writers of those excelent projects.
License :
This document and its derivatives are licenced under the GNU free document license. (any version)
www.gnu.org
Request :
To err is human, Please point out any errors, typos in commands in the document, thanks. If you notice any italics tags within code, please notify me. Thanks.
Edit History:
Last edited at 25-6-2006 21:18 pm, edited four times in total.
=> A minor mistake corrected.
=> Altered document in accordance with changing times.
Ok, You've installed linux, Gr8! Here is a free cookie.
But learning and using linux will be meaningfull with the knowledge of the following ESSENTIAL *nix commands and their PRACTICAL applications.IMHO Here are a few commands which we'll be using typically for routine work as well as system administration of linux. Of course this guide is meant to be no where near comprehensive that's why i request our friends to add new commands which they think will be ESSENTIAL and USEFUL. Thanks a lot!
Addendums
Addendum 1: bash cheatsheet
Here are a few nifty stuff you can use with the following commands,
| =====> Pipe stuff out
&& =====> Combine commands
\ =====> Use next line to start a added command interpreter without executing the previous command
>> =====> Save output to a file by appending it
> =====> Save output to a file by deleting its contents
< =====> Direct contents of a file to a command
ctrl+c =====> Finish the running command
ctrl+l =====> Clear screen
fg =====> to bring a suspended process to foreground
bg =====> to make a process to go to background.
-v =====> print verbose output
& =====> Executes the current command in the background and gives u access to the terminal.. eg: gimp&
Addendum 2: copypasting within terminal
If working on root terminal, you need to have gpm enabled to select stuff with the mouse and use the middle mouse button to paste them. If workin on a terminal emulator,
Select stuff with mouse and then,
[shift] + [delete] ==> copies stuff
[shift] + [insert] ==> paste stuff
All these are extremely useful for posting outputs of the command in online support forums.
Now to the command reference,
1 . Mount :
Mount command is used to mount a filesystem. To mount a FS we use the mount command followed by mount point or device file name as shown here,
the syntax is,
Code:
# mount something somewhere
1.
Code:
mount /mnt/cdrom
2.
Code:
mount /dev/hdc /mnt/cdrom
Popular Parametres:-
a. -t
One of the most important param to mount command is -t which specifies the filesystem type,
For example, if one wants to mount a ntfs FS
Code:
mount -t ntfs /dev/hda1 /mnt/win_c
You can specify different FS's such as reiserfs, fat32 etc along with -t . Msdos formatted floppies use 'msdos' filesystem. if you are unsure abt the partition use '-t auto' to try making the shell guess the mount point.
b. -r
The -r param helps you to mount stuff in a read-only filesystem or mount stuff as readonly.
c. -w
The -w param helps to mount the filesystem with write option. Special case for us is that knoppix livecd usually mounts the hdd's partitions as readonly as default. You use this option to mount partitons using write permission just in case you need to trouble shoot a boot loader config.
d. -o loop
The -o loop option parametre is used to mount ISO disk images to another directory and view the contents of the ISO.
For example you want to view the contents of a D/L'ed ISO
Code:
mount ubuntu-breezy-5.10-i386.iso /mnt/image -o loop
2. Umount :
The umount command helps to unmount filesystems. You can invoke this with,
Code:
umount /dev/hda2 (device name) or
umount /mnt/win_c (directory mounted)
Popular Parametres:-
a. -f
This -f parametre forcefully umounts a network filesystem or an unreachable filesystem.
b. -l
Force unmount the filesystem. We especially use this command when we come out of a chrooted partition and wan't to unmount that filesystem,(IME usual problem with knoppix) it would be busy. We can use lsof command to check which programs are accesing the filesystem and unmount it.
3. fdformat :
This command performs a low-level floppy disk format
Code:
fdformat /dev/fd0
4. mkfs :
Using the mkfs command you can create any supported filesystem on an accesible diskvolume. This is high-level formatting and data lost is lost forever.
For example, if we wan't to create a windows boot floppy quickly, all you have to do is
Code:
mkdosfs /dev/fd0
Code:
mkreiserfs /dev/hda3
mke2fs -j /dev/hda3
mkswap /dev/hda3
mke2fs /dev/hda3
mkjfs /dev/hda3
Code:
mkfs -t reiserfs /dev/hda3
5. cp :
As the name suggests, copies files from here to there.
Code:
cp $LINUX/i386/boot/bzimage /boot/bzimage
Popular parametres:-
a. -a
The -a parametre is used to archive a directory to another location, maybe as a backup also i saves file permissions and symbolic links status. Used for backing up file WITH permissions, so that you can replace if something gets screwed up.
b. -b
Ths -b param instructs the cp to make backup of any file with the same name in the destination directory as the copyied file so that the command doesn't explicitly ask you to what to do.
c. -f
This param instructs the command to forcefully replace any exixting file with the same name as the copyied file.
d. -r
Copies files and folders again and again recursively.
e. -i
Asks for confirmation b4 replacing any existing file.
6. mv :
As the name suggests moves files from here to there and as the name doesn't suggest it also renames files.
Code:
mv /home/user/file1 /home/user/files/file1 <moves file1 >
mv /home/user/file1 /home/user/file2 <renames file1 to file2>
The parametres for cp also apply to mv.
7. rm :
This command coressponds to delete
Code:
rm /home/user/garbage1 <where garbage1 is the deleted file>
Code:
rm -R /home/luser <where /home/luser is the deleted directory>
Always re-check a rm command because a file rm'ed is pretty much deleted. The params of cp and mv also applies to rm.
8. ln :
There are two types of links, hardlinks and symbolic links. Hardlinks refer to link for the same file with two or more directory entry. That is say a file called file1 resides at /home/user and we create a link for this file1 to /home/user/files/file1 then the file resides on both and is deleted only when both the references are deleted. Symbolic links are softlinks that refer to the file, like a pointer from another location. We can use ln or cp command to create hard as well as symbolic links. We use
cp -l to create hard links and cp -s to create symbolic links. However my favourite method is ln.
Code:
ln /home/user/file1 /home/user/files/file1 <hard link>
ln -s /home/user/file1 /home/user/files/link1 <symbolic link>
If you get hold of software binaries, you can simply copy the directory to a conventional location, say for azureus to /opt and create a symlink pointing to /usr/bin so that you need not cd into the azureus directory and start it with ./azureus.
Code:
ln -s /opt/azureus/azureus /usr/bin/azureus
9. ls :
Using ls to view the file contents is one of the fun parts of linux, practically when ls is combined with switches and sequences you don't even need a graphical file manager.
The following ls command is used to view the contents of the folder with permissions.
Code:
ls -l
Code:
ls /etc/X11/x*
Using [tab] autocompletion along with these neat tricks makes bash one of the most favourite shells for users.
10 cd :
Change into a directory from another directory.
Code:
cd /usr/local
you can use pwd to view the current working directory.
11 mkdir :
Create a new directory within the current directory or another directory anywhere else.
Code:
mkdir shared (make a directory shared within the current /usr/local directory)
mkdir /usr/local/bin (make a directory bin within /usr/local)
12 chmod :
Change the permissions to files or directories.
To check permissions of a 'new' directory you can use the following command
Code:
ls -ld new
drwxr-xr-x <owner> <group> <modified time>
{file-type} {owner} {group} {others}
<directory><read-write-execute> <read-xxx-execute> <read-xxx-execute>
to change em'
Code:
chmod 700 new
changes the permissions to rwx------ meaning no access to group as well as others and full access to the owner.777 =======> rwxrwxrwx
755 =======> rwxr-xr-x
700 =======> rwx------
644 =======> rw-r--r--
000 =======> ---------
There are several numbers denoting file permissions as modes. The popular is 700 which gives full access to the owner.
Popular Parametres:
A most used parametre is -r to recursively change permissions to direcotries and files within them. for example,
Code:
chmod 700 -r new
13. chown :
Change the ownership to files or directories
to change the owner for a 'new' file or folder to a new owner.
Code:
chown user1 new
Normally we use the this command recursively with -r option to change recursively the ownership of directories.
Code:
chown -r user1 new
14. df -h :
The df command is used to view info abt all mounted partitions.
Use df -h to find the used and free space of your hard disk volumes.
Code:
df -h
Code:
Filesystem Size Used Avail Use% Mounted on
/dev/hda4 7.1G 4.5G 2.6G 64% /
udev 505M 168K 505M 1% /dev
/dev/hda1 21G 18G 2.5G 88% /home
/dev/hda2 9.9G 2.3G 7.1G 25% /backup
/dev/hda3 266M 16M 237M 7% /boot
none 505M 0 505M 0% /dev/shm
15. pciutils :
Pciutils are a set of utils to make the life of a *Nix system admin easier
1. lspci:
View your pci devices. This displays all the devices connected via pci. Normally we either use grep to search the output and display the ones we want.
For example,
Code:
lspci | grep VGA <outputs your VGA device>
01:00.0 VGA compatible controller: nVidia Corporation NV40 [GeForce 6800 GT] (rev a1)
similarly,
Code:
lspci | grep audio <outputs your audio device>
00:1f.5 Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller (rev 02)
Or, you can pipe the entire thing view it using more or less, or you can save it as a log and view using your editor.
Code:
lspci | more
lspci >> log
2. lsmod :
Displays the loaded modules,
Code:
lsmod
Module Size Used by
snd_intel8x0 30944 0
snd_ac97_codec 91900 1 snd_intel8x0
snd_ac97_bus 2944 1 snd_ac97_codec
nvidia 4086128 12
3. lsusb :
Displays the CONNECTED usb devices.
Code:
lsusb
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
4. lsof :
This program displays informations on open files, used devices etc.,
Code:
lsof | grep /mnt/cdrom
5. dmesg :
Displays the kernel output messages while boot time.
Code:
dmesg | less
16. du :
The du command displays the disk usage by partition by partition basis. For example,
Code:
du /usr <displays how much space each directory in /usr is consuming>
For example,
Code:
du --max-depth=1 /opt <outputs>
11283 /opt/xpde
12 /opt/libreadline-java
10432 /opt/eclipse-extensions-3.1
10789 /opt/opera
15397 /opt/RealPlayer
89309 /opt/blackdown-jdk-1.4.2.03
5511 /opt/eclipse-extensions-2
10927 /opt/eclipse-extensions-3
21928 /opt/firefox
28961 /opt/thunderbird
20278 /opt/sunbird
1248 /opt/netscape
72972 /opt/sun-jre-bin-1.5.0.06
55232 /opt/blackdown-jre-1.4.2.03
400 /opt/blackdown-java3d-bin
354677 /opt
17. stat :
This command displays information about files like ls -ld with permissions, ownership etc.,
But with several other tasty stuff.
Code:
stat /opt <outputs>
File: `/opt'
Size: 568 Blocks: 1 IO Block: 131072 directory
Device: 304h/772d Inode: 108 Links: 17
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2006-02-12 13:06:18.000000000 +0530
Modify: 2006-02-28 05:03:43.000000000 +0530
Change: 2006-02-28 05:03:43.000000000 +0530
18. uptime :
This command returns the uptime of the system. useful for knowing uptime of servers.
Code:
uptime <outputs>
20:50:00 up 2:10, 4 users, load average: 0.00, 0.00, 0.00
19. free :
This command lists the memory usage of the system.
Code:
free <outputs>
total used free shared buffers cached
Mem: 1032792 447436 585356 0 79380 140872
-/+ buffers/cache: 227184 805608
Swap: 0 0 0
20. who and finger :
the commands who and finger provide information abt users logged in to the system.
Code:
who <outputs>
sathya :0 2006-02-28 18:40
sathya pts/0 2006-02-28 18:40
sathya pts/1 2006-02-28 18:56
sathya pts/2 2006-02-28 19:55
Code:
finger <outputs>
Login Name Tty Idle Login Time Office Office Phone
sathya *:0 Feb 28 18:40
sathya pts/0 2:11 Feb 28 18:40
sathya *pts/1 1:10 Feb 28 18:56
sathya *pts/2 Feb 28 19:55
21. top :
This is such an essential command which is very hard to ignore. This is more of a utility than a command
Code:
top <outputs>
top - 20:56:16 up 2:16, 4 users, load average: 0.00, 0.00, 0.00
Tasks: 83 total, 1 running, 82 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0% us, 0.0% sy, 0.0% ni, 100.0% id, 0.0% wa, 0.0% hi, 0.0% si
Mem: 1032792k total, 447580k used, 585212k free, 79624k buffers
Swap: 0k total, 0k used, 0k free, 141036k cached
< c o m m a n d l i n e to execute stuff within top ----------------->
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5616 root 16 0 60820 49m 3844 S 0 4.9 1:31.47 X
1 root 16 0 1460 516 448 S 0 0.0 0:00.69 init
2 root RT 0 0 0 0 S 0 0.0 0:00.00 migration/0
3 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/0
4 root RT 0 0 0 0 S 0 0.0 0:00.00 migration/1
5 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/1
6 root 10 -5 0 0 0 S 0 0.0 0:00.09 events/0
7 root 10 -5 0 0 0 S 0 0.0 0:00.00 events/1
8 root 10 -5 0 0 0 S 0 0.0 0:00.00 khelper
9 root 11 -5 0 0 0 S 0 0.0 0:00.00 kthread
12 root 10 -5 0 0 0 S 0 0.0 0:00.00 kacpid
86 root 10 -5 0 0 0 S 0 0.0 0:00.01 kblockd/0
87 root 10 -5 0 0 0 S 0 0.0 0:00.00 kblockd/1
90 root 10 -5 0 0 0 S 0 0.0 0:00.00 khubd
182 root 20 0 0 0 0 S 0 0.0 0:00.00 pdflush
183 root 15 0 0 0 0 S 0 0.0 0:00.04 pdflush
As you can see x consumes a lot of memory and is displayed in the top.
Commands:
Top Cheat sheet:
r --> change the nice value for processes
k --> kill a process with process ID
N --> sorts by PID number
M --> sorts by memory usage
T --> Cpu time used.
m --> toggles display of system memory info.
h --> help with top
q --> quit top.
22. Process manipulation :
ps and pstree commands are used to deal with processes. ps outputs processes info and pstree outputs tree like info structure.
1. ps
Code:
ps <outputs>
PID TTY TIME CMD
6030 pts/2 00:00:00 su
6033 pts/2 00:00:00 bash
6156 pts/2 00:00:00 ps
2. pstree
Code:
pstree <outputs>
initacpid
6*[agetty]
cron
dbus-daemon
dbus-launch
dcopserver
events/0
events/1
gam_server
gconfd-2
gdmgdmX
startkdekwrapper
ssh-agent
gpm
2*[jfsCommit]
jfsIO
jfsSync
kaccess
kded
kdeinitartsd
kio_file
klauncher
konqueror
konsolebashemacs
konsolebashsubashpstree
kwin
mozilla-launchefirefox-bin2*[{firefox-bin}]
kdesktop
khelper
khpsbpkt
kicker
kio_uiserver
kirqd
klipper
knotify
korgac
ksmserver
ksoftirqd/0
ksoftirqd/1
kswapd0
kthreadaio/0
aio/1
ata/0
ata/1
kacpid
kblockd/0
kblockd/1
khubd
kseriod
2*[pdflush]
reiserfs/0
reiserfs/1
xfsbufd
xfsdatad/0
xfsdatad/1
xfslogd/0
xfslogd/1
migration/0
migration/1
sshd
syslog-ng
udevd
xinetd
3. nice and renice
nice and renice commands are used to start a process and set process with different priorities.
Code:
nice <option> <command>
Code:
renice -2 -p [i]nnnnn[/i]
4. kill
This kill command is used to kill a process with a -s signal and process id.
Code:
kill -l (use this to display the list of signals)
kill -s [i]signal[/i] pid[...]
23. grep :
Search and limit output using grep
The grep command is used to search and limit the output, like we did when using lspci utilities.
For example, if you want to view screen information for your screens in XORG.Conf(/etc/X11/xorg.conf)
Code:
more /etc/X11/xorg.conf | grep Screen <outputs>
Screen 0 "Screen0" 0 0
Section "Screen"
Identifier "Screen0"
24. slocate :
Use this security enhanced version of locate to get files and folders info.
First you need to create a directory index
Code:
slocate -u
then search for files
For example,
Code:
slocate xorg.conf <outputs >
/etc/X11/xorg.conf.example
/etc/X11/xorg.conf
/usr/share/man/man5/xorg.conf.5x.gz
/usr/portage/app-emulation/vmware-linux-tools/files/4.5.2/xorg.conf
/usr/portage/app-emulation/vmware-linux-tools/files/5.0.0/xorg.conf
25. echo :
The command echo is used to print stuff in the standard output.
for example,
Code:
echo hello world <outputs>
hello world
for example,
Code:
echo \
> GENTOO_MIRRORS="*mirror.phy.olemiss.edu/mirror/gentoo"\
> >> /etc/make.conf
But watchout though! i ended up totally cleaning my /etc/make.conf by using >param which deletes the contents of the file and adds the echoed stuff. So always make sure you use >> .
So that ends things up., but let this thread be used by all of us to add the commands that we think will be useful for a new linux user to learn and implement. Lets start linuxing, shall we?
Credits :
1. Linus, RMS and friends for creating this awesome OS.
2. All programmers, coders and hackers.
3. Esr and friends of 'OpenSource' movement.
4. All MAN page and document writers of those excelent projects.
License :
This document and its derivatives are licenced under the GNU free document license. (any version)
www.gnu.org
Request :
To err is human, Please point out any errors, typos in commands in the document, thanks. If you notice any italics tags within code, please notify me. Thanks.
Edit History:
Last edited at 25-6-2006 21:18 pm, edited four times in total.
=> A minor mistake corrected.
=> Altered document in accordance with changing times.
Last edited: