Useful Shell Commands

From ReduxWiki

Jump to: navigation, search

Contents


[edit] Common

# Display help on a specific command
man <command>

# Connet to an FTP server
ftp <site>

# View a webpage (text)
lynx <site>

# Display HDD Stats
df -h

# Display Quota
quota

# Display the uptime
uptime

# Display OS statastics
uname -a

# Display last login
last

# Find out where a file is located
whereis <file>

# Display processes you are running
ps -x

# Display (ALL) Processes Running
ps -a

# Display running Processes w/ CPU and MEM
ps -aux


[edit] Navigation

# Move to a Directory
cd <dir>

# Move to a lower Directory
cd ..

# Move to your Home Directory
cd ~

# Move to previous directory
cd -

# Display a directory listing
ls

# Display a directory listing including hidden
ls -a

# Display a complete directory listing w/ Size and Time-stamp
ls -alh

# Display path of current directory
pwd


[edit] Arranging

# Copy a file
cp <filename>

# Move a file to a new file (rename)
mv <oldfile> <newfile>

# Create a Directory
mkdir <directory>

# Delete a Directory
rmdir <directory

# Delete a File
rm <filename>

# Delete a Directory and all files within
# !! Be Careful with -rf !!
rm -rf <directory>


[edit] Packaging

# Uncompress tar.gz
tar -zxpf <file.tar.gz>

# Uncompress .tar
tar -xpf <file.tar>

# Uncompress .gz
gunzip <file.gz>


[edit] Kill

# Kill off a Process
kill -9 <pid>

# Kill all running processes
killall -9 <program>


[edit] File Editors

# Pico
pico <file>

# Nano
nano <file>

# VI
vi <file>




Image:Tip.png Back to How To Documents
Personal tools