A few useful Linux commands for the newbie
Saturday, February 16th, 2008Here is a list of a few useful Linux commands for us newbies. =]
This are most of the commands that i have come to use in Linux, this are the ones that I think it’s worth to at least know. You never know when it will come in handy…
- ls - Works the same as “dir” in DOS, lists all the files and folders at the current path.
- cat filename - Pasts the contents of filename to the screen.
- man command - Loads the manual file for the command\program.
- wget url - I think this actually a program but it will most likely be available on every Linux system you will use. It fetches the file\page at the url.
- mkdir name - Create a directory named name.
- rm filename - Delete filename.
- rmdir foldername -Delete foldername.
- ps - Lists processes.
- passwd - Change the password of the current user.
- chmod - Read about this one, this is used to change the rights regarding read/write/execution of a file or folder.
- chown - Used to change the owner of a file or folder.
- cp filename1 filename2 - Used to copy files from filename1 to filename2.
- df - Used to review hard-drive space, personally, I use it with “-hT”.
- fdisk /dev/*** - Used to partition a hard-drive, usually the drives location will be /dev/hda or /dev/sda or /dev/hdb and so on…
- find key - Find files on the file system. I am not very familiar with it but I know that sometimes you would prefer to use locate.
- grep regularExpression- used to find lines that correspond with the regularExpression usually used in parallel to another command like ps. [ps | grep cups]
- ifconfig -Lists the available network adapters and their status.
- kill - Stop a process by PID[Program ID].
- killall - Stop a process by name.
- lsmod - Lists currently loaded modules[this is a subject of it's own].
- rmmod mode - Unload a module from the kernel.
- lsusb - Lists all USB devices.
- mount - Used to mount a device/partition to a certain path.
- umount - Used to un-mount a device/partition.
- dig serverAddress -Used to query the DNS server.
- sftp - ftp, but secure!.
- ssh address - Connect to a SSH server at address.
- su username - Start using the shell as username.
- sudo command - Run command as if you were root. This command is currently used in many different distros to re-authenticate the user in order to make sure this is not some kind of a harmful program.
- tar - Create or restore file from a tarball.
- traceroute address - Shows the entire route it takes a request in order to get to address. Useful when trying to find bottle necks in networks.
For more info on any of this commands either use “man” or call the command and “–help” or “-h” after the command(or click the link…). It should list the different possibilities of usage to that command.
Hope this helps you with your Linux endeavours. BTW - most or at-least some of the commands should work on UNIX based systems as well. This is due to the fact that both Linux and UNIX adhere to POSIX.
Until next time, have a good one! =]
Nadav