Published: December 23, 2025
Bash (Bourne-Again SHell) - Used to write scripts and run commands in unix based systems.
Shell - Text based interface to talk to the computer. Its's both a command interpreter and a programming language. As a command interpreter, it gives access to the GNU utilities and as programming language it combines these utilities.
Files can be created containing these commands and the files become commands.
ls - List directories-l - Long list formatting - Gives detailed information about files and folders such as file permission, number of links, owner name, owner group, file size, time of last modification, file/directory name. Sample output -rw-r--r-- 1 kavete kavete 873 Nov 18 10:00 test.txt-a - Include hidden files-h - Human readable sizes - Uses kilobytes, Megabytes etc instead of bytes. Use with long listing format -lh-t - Sort by modification date / time-r - Reverse order while sorting-R - List sub-directories recursively-S - Sort by file size - Largest file size first.-1 - List one file per line-d -List directories themselves, not their contents.-F - Append indicators (/=@|*) to entries / Directories
@ Symbolic links
* Executables
cd - Change directorycd .. - Move up one directory
cd ~ - Move to the home directory
cd - - Move to the previous directory
cd / - Move to the root directory
mkdir - Make a new directory-p -Create parent directories as needed
Example: mkdir -p parent/child
-v -Show a message for each created directory (Verbose output)
-m - Set file mode (permissions)
Example: mkdir -m 755 some_dir
pwd - Print working directory-L -Show the logical path, including any symbolic links (default).
Sample output: /sbin
-P - Show physical path, resolving any symbolic links to their actual locations.
Sample output (If /sbin actually pints to /usr/bin): /usr/bin
mv - Move or rename filesmv source_file destination_directory
Example: mv file.txt /some_path/in/computer/
mv old_file.txt new_file.txt
-i - Ask before replacing files
-u - Move only if the source is newer
-v - Verbose mode (show files being moved)
Wildcards can be used to move multiple files at once. Example mv *.rs /rust will move all files with .rs extension to the rust directory.
cp - Copy files and directoriescp source destination - Makes a duplicate of the file/directory.
-r - (Recursive) Copy all files and folders inside a directory -i -(interactive mode) Ask before replacing files -u - Copy only if the source is newer - - (Verbose mode) Show files being copied rm - Delete/ Remove files and directories-r - Delete a folder and everything inside it -f - Force delete without asking -i and -v echo - Display a line of text.-E -Don't allow special characters (default). e - Allow special characters like \n for new lines. -n - Don't add a new line at the end. (It's added by default)cat - Concatenate and display filesUsed to show content of files. Can also be used to combine multiple files into one.
-n - Add numbers to each line. -b - Add numbers to the lines with text. (Ignore empty ones). -s -Remove extra empty lines. It leaves only a single blank line where multiple ones exist. -v - Show non-printing characters, except for tabs and end of line. cat main.rs build.rs > lib.rs - Takes the contents of build.rs and main.rs and writes them into lib.rs
cat with pipingthe cat command is often used in conjunction with piping to send the content of files to other commands. Example: cat main.rs | ripgrep "panic"
touch <filename> - Create a new file or update it's time-a - (Access) Update only when the file was last read. -m - (Modification) Update only when the file was last changed. -t - Set the timestamp to a specific time.touch -t 202601010000 memory.x
-c - Do not create any files if they do not exist. Example: man ls
Used for :
1. Moving the cursor
2. Deleting characters, words, lines etc
3. Performing …
Git - Version control system