Searchable UNIX Commands Guide (SUCG)

ls

Description: List directory contents

Usage: ls [options] [file]

Example: ls -l /home/user

cd

Description: Change the shell working directory

Usage: cd [directory]

Example: cd /var/log

mkdir

Description: Make directories

Usage: mkdir [options] directory

Example: mkdir new_folder

rm

Description: Remove files or directories

Usage: rm [options] file

Example: rm -r my_folder

cp

Description: Copy files and directories

Usage: cp [options] source destination

Example: cp file1.txt file2.txt

mv

Description: Move (rename) files

Usage: mv [options] source destination

Example: mv oldname.txt newname.txt

cat

Description: Concatenate and display file content

Usage: cat [options] file

Example: cat myfile.txt

echo

Description: Display a line of text

Usage: echo [options] string

Example: echo "Hello, World!"

find

Description: Search for files in a directory hierarchy

Usage: find [path] [expression]

Example: find /home -name "*.txt"

grep

Description: Print lines matching a pattern

Usage: grep [options] pattern [file]

Example: grep "hello" myfile.txt

chmod

Description: Change file modes or Access Control Lists

Usage: chmod [options] mode file

Example: chmod 755 script.sh

chown

Description: Change file owner and group

Usage: chown [options] owner[:group] file

Example: chown user:group myfile.txt

ps

Description: Report a snapshot of current processes

Usage: ps [options]

Example: ps aux

kill

Description: Send a signal to a process

Usage: kill [options] pid

Example: kill -9 1234

top

Description: Display Linux tasks

Usage: top

Example: top

df

Description: Report file system disk space usage

Usage: df [options]

Example: df -h

dd

Description: Convert and copy a file

Usage: dd [options]

Example: dd if=/dev/zero of=testfile bs=1M count=10

du

Description: Estimate file space usage

Usage: du [options] [file]

Example: du -sh *

man

Description: An interface to the system reference manuals

Usage: man [command]

Example: man ls

sudo

Description: Execute a command as another user

Usage: sudo [command]

Example: sudo apt-get update

ssh

Description: OpenSSH remote login client

Usage: ssh [options] [user@]hostname

Example: ssh user@server.com

scp

Description: Secure copy (remote file copy program)

Usage: scp [options] [[user@]host1:]file1 ... [[user@]host2:]file2

Example: scp file.txt user@server.com:/path/to/destination

curl

Description: Transfer a URL

Usage: curl [options] [URL]

Example: curl -O http://example.com/file.txt

wget

Description: The non-interactive network downloader

Usage: wget [options] [URL]

Example: wget http://example.com/file.txt

ping

Description: Send ICMP ECHO_REQUEST to network hosts

Usage: ping [options] destination

Example: ping google.com

traceroute

Description: Print the route packets take to the network host

Usage: traceroute [options] host

Example: traceroute google.com

netstat

Description: Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships

Usage: netstat [options]

Example: netstat -tuln

ifconfig

Description: Configure a network interface

Usage: ifconfig [interface]

Example: ifconfig eth0

iptables

Description: Administration tool for IPv4 packet filtering and NAT

Usage: iptables [options]

Example: iptables -L

tar

Description: An archiving utility

Usage: tar [options] [archive-file] [file or directory]

Example: tar -czvf archive.tar.gz /path/to/dir

gzip

Description: Compress files

Usage: gzip [options] [file]

Example: gzip file.txt

gunzip

Description: Decompress files

Usage: gunzip [options] [file]

Example: gunzip file.txt.gz

zip

Description: Package and compress (archive) files

Usage: zip [options] [archive file] [file or directory]

Example: zip -r archive.zip /path/to/dir

unzip

Description: List, test, and extract compressed files in a ZIP archive

Usage: unzip [options] [zipfile]

Example: unzip archive.zip

hostname

Description: Show or set the system's hostname

Usage: hostname [options] [new_hostname]

Example: hostname

uptime

Description: Tell how long the system has been running

Usage: uptime

Example: uptime

whoami

Description: Print the current user id and name

Usage: whoami

Example: whoami

passwd

Description: Update a user's authentication tokens

Usage: passwd [options] [username]

Example: passwd

useradd

Description: Create a new user or update default new user information

Usage: useradd [options] username

Example: useradd newuser

usermod

Description: Modify a user account

Usage: usermod [options] username

Example: usermod -aG sudo username

userdel

Description: Delete a user account and related files

Usage: userdel [options] username

Example: userdel username

groupadd

Description: Create a new group

Usage: groupadd [options] groupname

Example: groupadd newgroup

groupdel

Description: Delete a group

Usage: groupdel [options] groupname

Example: groupdel groupname

groupmod

Description: Modify a group

Usage: groupmod [options] groupname

Example: groupmod -n newgroupname oldgroupname

su

Description: Run a command with substitute user and group ID

Usage: su [options] [username]

Example: su -

alias

Description: Define or display aliases

Usage: alias [name='value']

Example: alias ll='ls -l'

unalias

Description: Remove alias definitions

Usage: unalias [name]

Example: unalias ll

history

Description: Command History

Usage: history [options]

Example: history

clear

Description: Clear the terminal screen

Usage: clear

Example: clear

exit

Description: Exit the shell

Usage: exit

Example: exit

uname

Description: Print system information

Usage: uname [options]

Example: uname -a

date

Description: Print or set the system date and time

Usage: date [options]

Example: date

cal

Description: Display a calendar

Usage: cal [options]

Example: cal

bc

Description: Command-line calculator

Usage: bc [options]

Example: echo "10 + 5" | bc

id

Description: Print real and effective user and group IDs

Usage: id [options] [username]

Example: id

w

Description: Show who is logged on and what they are doing

Usage: w [options]

Example: w

last

Description: Show listing of last logged in users

Usage: last [options]

Example: last

watch

Description: Execute a program periodically, showing output fullscreen

Usage: watch [options] command

Example: watch -n 1 "date"

at

Description: Schedule commands to be run at a later time

Usage: at [options] time

Example: at now + 1 hour

crontab

Description: Schedule periodic background work

Usage: crontab [options]

Example: crontab -e

shutdown

Description: Shutdown or restart the system

Usage: shutdown [options] [time]

Example: shutdown -r now

reboot

Description: Reboot the system

Usage: reboot

Example: reboot

fold

Description: Wrap each input line to fit in specified width

Usage: fold [options] [file]

Example: fold -w 30 myfile.txt

col

Description: Filter reverse line feeds from input

Usage: col [options]

Example: col -b < input.txt > output.txt

nl

Description: Number lines of files

Usage: nl [options] [file]

Example: nl -s ". " myfile.txt

rev

Description: Reverse lines of a file or files

Usage: rev [options] [file]

Example: rev myfile.txt

look

Description: Display lines beginning with a given string

Usage: look [options] string [file]

Example: look "apple" /usr/share/dict/words

factor

Description: Print prime factors of specified integer numbers

Usage: factor [options] number

Example: factor 56

units

Description: Convert units from one scale to another

Usage: units [options]

Example: units "miles/hour" "km/hour"

uicache

Description: Refreshes the User Interface Cache, including Home Screen icons

Usage: uicache

Example: uicache

Limited availability: iOS - Jailbroken