Bash Commands Flashcards
ls
lists the directory contents, common flags are -a, -l
echo
prints text to the terminal window. Used in scripts and batch files, shows the value of environmental variables. Common flags; -e, -n
touch
creates files in the current directory. Common flags; -a, -m, -r, -d
mkdir
Makes a directory in the current directory.
grep
“Global Regular Expression” searches for text patterns specified by the user. Common options; -i, -c, -n, -r, -v
man
print manual or get help for a command.
pwd
“Print Working Directory”
cd
“change directory”
.. to go up one directory
use a name to go into
or an absolute path
mv
Move/Rename a directory
rmdir
removes empty directories
rm
removes directories/files
rm -r //force remove file/directory
locate
finds a file or directory
less
allows user to view the contents of a file in the terminal
compgen
shows all available commands, aliases, and functions.
cat
a command for reading files, creating files, and concatenating files.
|
operator to take the standard input of one command and pass it as the input for another.
head
read the first few lines of a file
tail
read the end of a file
chmod
sets the permissions flag on a file or folder
exit
ends the execution of a shell script, close a terminal window
more
loads the entire file into the terminal for reading
curl
downloads or uploads data using protocols such as FTP, SFTP, HTTP, and HTTPS