If you are new to Linux and the command line, this Bash Cheat Sheet Pdf can help you get started. The cheat sheet includes common commands for getting around the file system, managing files and directories, working with text files, and more. With these basic commands, you will be able to navigate your way through the Linux command line with ease.
If you’re like me, you often find yourself Googling for bash commands when working in the terminal. To help make life easier, I’ve compiled a list of some of the most common and useful bash commands into a handy cheat sheet.
Feel free to download and print this out for easy reference.
I hope you find it as helpful as I do!
Bash Commands Cheat Sheet:
ls – list files and directories
cd – change directory
mkdir – make directory
cp – copy file or directory
mv – move or rename file or directory
rm – delete file or directory (use with caution!) .rmdir- delete empty directory
cat- display contents of a file less- page through a file head- display first few lines of a file tail- display last few lines of a file grep- search for text pattern in a file wc- count number of lines/words/characters in a file sort- sort contents of a file uniq- remove duplicate lines from sorted output chmod- change permissions on a file
Linux Command Cheat Sheet
Bash Cheat Sheet Github
If you’re a developer, chances are you spend a lot of time working in the command line. And if you’re working in the command line, you probably spend a lot of time using Bash. Bash is a powerful shell that allows you to do a lot of things, but it can be intimidating for newcomers.
That’s why we’ve put together this Bash cheat sheet to help you get started.
This cheat sheet includes common Bash commands that will help you navigate the command line, work with files and directories, and execute programs. We’ll also show you some handy tips and tricks that will make using Bash even easier.
So whether you’re new to Bash or just need a refresher, this cheat sheet has everything you need to get started.

Credit: www.ubuntupit.com
What is $@ in Bash?
In bash, $@ is a special variable that represents all of the positional parameters (arguments) in an array. This means that when you use $@ as an argument to a command, each element in the array will be expanded into a separate word. For example, if you have a script that takes two arguments and prints them out, you could use $@ like this:
./myscript.sh one two
This would print “one” and “two” on separate lines.
What are Basic Bash Commands?
Bash is a Unix shell and command language written by Brian Fox for the GNU Project as a free software replacement for the Bourne shell. First released in 1989, it has been distributed widely as the default login shell for most Linux distributions and Apple’s macOS Sierra and earlier versions. A version is also available for Windows 10.
Bash is a powerful programming language that provides many tools for managing files and directories, manipulating text, running programs, and much more. In this article, we’ll give you a brief introduction to some of the most common bash commands.
The ls Command
ls is one of the most commonly used bash commands. It’s used to list the contents of a directory. For example, if you want to see what files are in your current directory, you can use ls like this:
$ ls
This will print a list of all files (and subdirectories) in your current directory. By default, ls will list files in alphabetical order.
However, there are many options you can use to customize the output. For example, if you want to list files in reverse alphabetical order, you can use the -r option:
$ ls -r
What is $1 And $2 in Bash?
$1 and $2 are special variables in bash that refer to the first and second positional parameters passed to a function, script, or program.
Positional parameters are a series of special variables used by many programming languages, including bash, that hold the values of the arguments supplied to a program or function. The first argument is typically stored in $1 , the second argument in $2 , and so on.
In bash, $0 always refers to the name of the currently executing script or program. However, $1 and $2 will only be populated if they are actually provided as arguments when calling a script or program. For example:
./script.sh arg1 arg2 # sets $1 = “arg1” and $2 = “arg2” ./script.sh # sets only $0 = “./script.sh”, since no args were provided
If you attempt to reference a positional parameter that wasn’t set (e.g., trying to print $3 when only two arguments were provided), you’ll simply get an empty string outputted:
What Does Bash Stand For?
Bash is a Unix shell and command language written by Brian Fox for the GNU Project as a free software replacement for the Bourne shell. First released in 1989, it has been distributed widely as the default login shell for most Linux distributions and Apple’s macOS Mojave and earlier versions. A version is also available for Windows 10.
Conclusion
This blog post provides a cheat sheet for Bash, a Unix shell and command-line interpreter. The cheat sheet includes common commands for navigation, file manipulation, and system administration. It also covers some of the more advanced features of Bash, such as command line editing and history.
Leave a Reply