Friday, February 8, 2008

Useful Linux commands


This is in no way a complete list of Linux commands, but beginners should find this list very helpful, I would recommend doing a info or man on any of the commands from this list that you use to get a better understanding of what it can do. If you have anything you think should be in this list feel free to email me.

ls :: list files in dir

ls -a :: list all files + hidden in dir

df :: shows free disk space

pwd :: tells you what dir you are in

find [FILE]:: Search for file

ps :: lists running programs and PID

cat [FILE] :: Read a text file

kill [PID] :: Kill the program with what ever PID you input

[FILE] | grep [WORD]:: Searches a file for a string or word

less [FILE] :: to read files that have more then one or two pages.

pico [FILE] :: text editor

rm -rf [DIR] :: deletes dir and all contents

tail [FILE] :: allows you to see the last few lines of a file w/o opening any programs like pico or cat

tar -zxvf [FILE].tar.gz :: untars a .tar.gz file

ifconfig :: shows network info like IP and such

ncftp :: nice FTP client

wget :: Use this to download files over protocols other then FTP

last :: shows a list of last logged in users

shutdown now :: puts the box in maintenance mode

shutdown -r now :: restarts the box

uptime :: shows you how long the system has been running

chmod [MOD] [FILE] :: change file privs

/usr/bin/gpasswd -a [USER] [GROUP] :: assigns USER to GROUP

chown [USER]:[GROUP] [FILE] :: change owner ship of file by user or group

groups [USER] :: shows what groups USER belongs to

su :: become root until exit

su- :: become root till exit and read root's environment settings

usermod -G [GROUP1],[GROUP2] [USER] :: Assign groups to a user

No comments: