Unix CLI Commands

Shared by a Flashcards.gg user · generated with AI · Report this set

This flashcard set covers essential Unix and Linux command line interface commands and their syntax for developers and system administrators.

61 cards English Level: Intermediate Computer fundamentals Published
Tap the card to flip it

Cards · 61

pwd
Prints the current working directory path. Syntax: pwd [options]
ls
Lists directory contents and file metadata. Syntax: ls [options] [file/dir]
cd
Changes the current working directory. Syntax: cd [directory]
mkdir
Creates one or more new directories. Syntax: mkdir [options] <directory>
rmdir
Removes empty directories. Syntax: rmdir [options] <directory>
touch
Updates file timestamps or creates empty files if missing. Syntax: touch [options] <file>
cp
Copies files and directories from source to destination. Syntax: cp [options] <source> <dest>
mv
Moves or renames files and directories. Syntax: mv [options] <source> <dest>
rm
Removes files or directories recursively with -r. Syntax: rm [options] <file/dir>
cat
Concatenates and displays content of files. Syntax: cat [options] [file...]
less
Views file contents interactively one screen at a time. Syntax: less [options] <file>
head
Outputs the first part (default 10 lines) of files. Syntax: head [options] [file...]
tail
Outputs the last part of files or monitors them live with -f. Syntax: tail [options] [file...]
echo
Prints text or variable values to standard output. Syntax: echo [options] [string...]
printf
Formats and prints text according to format specifiers. Syntax: printf <format> [arguments...]
man
Displays reference manual pages for commands and system calls. Syntax: man [section] <command>
which
Locates the executable file associated with a command. Syntax: which <command>
type
Describes how a command name would be interpreted by the shell. Syntax: type [options] <name>
find
Searches for files in a directory hierarchy by attributes. Syntax: find [path] [expression]
grep
Searches for patterns in files or standard input using regular expressions. Syntax: grep [options] <pattern> [file...]
wc
Prints newline, word, and byte counts for files. Syntax: wc [options] [file...]
sort
Sorts lines of text files. Syntax: sort [options] [file...]
uniq
Reports or filters out adjacent repeated lines in text. Syntax: uniq [options] [input [output]]
cut
Removes sections from each line of files by byte, character, or delimiter. Syntax: cut [options] [file...]
sed
Stream editor for filtering and transforming text via patterns. Syntax: sed [options] <script> [file...]
awk
Pattern scanning and processing language for structured text. Syntax: awk [options] 'program' [file...]
tr
Translates, squeezes, or deletes characters from standard input. Syntax: tr [options] <set1> [set2]
diff
Compares files line by line to show differences. Syntax: diff [options] <file1> <file2>
tar
Archives multiple files into a single archive file, optionally compressing. Syntax: tar [options] <archive> [file...]
gzip
Compresses files using the DEFLATE algorithm. Syntax: gzip [options] [file...]
chmod
Changes file mode bits and access permissions. Syntax: chmod [options] <mode> <file...>
chown
Changes file owner and group. Syntax: chown [options] <owner>[:<group>] <file...>
ps
Reports a snapshot of current running processes. Syntax: ps [options]
top
Displays real-time system summary information and running processes. Syntax: top [options]
kill
Sends a termination or other signal to specified processes. Syntax: kill [options] <pid...>
killall
Kills processes specified by command name. Syntax: killall [options] <name...>
df
Reports file system disk space usage across mounts. Syntax: df [options] [file...]
du
Estimates file space usage for directories and files. Syntax: du [options] [file...]
free
Displays amount of free and used memory in the system. Syntax: free [options]
uname
Prints system architecture and operating system information. Syntax: uname [options]
uptime
Shows how long the system has been running and load averages. Syntax: uptime [options]
whoami
Prints the effective user name of the current user. Syntax: whoami
sudo
Executes a command with superuser or other user privileges. Syntax: sudo [options] <command>
su
Switches the current user identity or starts a root shell. Syntax: su [options] [username]
ssh
Securely connects to and logs into remote Unix hosts. Syntax: ssh [options] [user@]hostname [command]
scp
Securely copies files between hosts over an SSH connection. Syntax: scp [options] <source> <dest>
rsync
Fast and versatile remote and local file-copying tool. Syntax: rsync [options] <source> <dest>
curl
Transfers data to or from a server using various protocols. Syntax: curl [options] <URL>
wget
Non-interactive network downloader for HTTP, HTTPS, and FTP. Syntax: wget [options] <URL>
ping
Sends ICMP ECHO_REQUEST packets to test network connectivity. Syntax: ping [options] <host>
traceroute
Tracks the packet route to an IP network host. Syntax: traceroute [options] <host>
netstat
Prints network connections, routing tables, and interface stats. Syntax: netstat [options]
ss
Dumps socket statistics, serving as a modern replacement for netstat. Syntax: ss [options] [filter]
crontab
Maintains scheduled automated task tables for individual users. Syntax: crontab [options] [file]
alias
Creates shortcuts or custom names for existing commands. Syntax: alias [name[=value]...]
export
Marks shell variables to be passed to child processes in the environment. Syntax: export <name[=word]...>
source
Executes commands from a specified file within the current shell context. Syntax: source <filename> [arguments]
history
Displays or manipulates the command history list. Syntax: history [options] [n]
ln
Creates hard or symbolic links between files. Syntax: ln [options] <target> <link_name>
tee
Reads from standard input and writes simultaneously to standard output and files. Syntax: tee [options] [file...]
xargs
Builds and executes command lines from standard input items. Syntax: xargs [options] [command [initial-arguments]]