Just like Windows, iOS, and Mac OS, Linux is an operating system. In fact, one of the most popular platforms on the planet, Android, is powered by the Linux operating system. An operating system is software that manages all of the hardware resources associated with your desktop or laptop. Basically, there are many linux commands and we shall be discussing as much as possible.
ls command : it allows the user to view the contents of a directory. It lists the files and directories. The ls command displays the contents of the current working directory by default( if the user does not specify any other directory). To check the directories, you can type the ls command followed by the directory path.
clear command : the clear command clears the terminal screen. This command-line parameters and does not take any argument.
pwd command : The full form of pwd command is print working directory. It allows users to find the path of the current working directory or folder they are in. The pwd command has two options:
. -L : prints a symbolic path
. -P : prints the actual full path.
- cd command : Use the cd command to navigate through the linux files and directories. You will have to write the full path or the name of the directory to use this command.
For example, if you are working in /home/username/documents and want to go in the pictures subdirectory, you can write cd pictures.
cp command: The cp command is used to copy and paste to a directory as a second argument.
mv command : the mv command stands for move. It is used to move file or directories from one place to another.
man command : the manual page (man) command is like a software documentation using which you can know what a particular command does and how it works.
cat command : it is used to print or merge the content from the line where the first file ends.
wget command : it is a handy command that can help you download files from the internet.
top command : this is similar to windows task manager , top command shows you the list of running processes and how much CPU is being used.
history command : is used to display that you've typed before.
wc command : it is used to count the number of lines (-1), words (-w)' bytes (-c), and characters (m).
passwd command : it is used to change the password of the user account. To use it, type passwd followed by the user name.
chown command : it is used to transfer ownership of file.
reboot command : it is used to shutdown, reboot, or hilt the system.
grep command : it is used to search and find text in a file.
locate command : similar to the search command in windows the locate command is used to know your device name.
hostname command : it is used to know your device name. Additionally, using the -I argument will help you know your IP address.
exit command : it can be used to close the terminal quickly.
rmdir command : it allows the user to delete a directory , provided that the directory is empty. You will need to ensure that there is no file or subdirectory under the directory that you want to delete.
mkdir command : it allows a user to create a new directory, and for windows users ,a new folder.
touch command: with the touch command , you can create a new blank file with the given name.
locate command : the locate command enables users to locate a file. If you don't remember the exact file name, you can use the -i argument to make it insensitive.
echo command : This command is used to show a text or a string to the standard output or a file.
$ echo “This is an article on fundamental linux commands”
This is an article on fundamental linux commands
The echo –e option operates as an interpretation of escape characters that are back-slashed.
$ echo –e “This is an article intended for beginners. \nIt is on fundamental linux commands Will show the output as
This is an article designed for beginners. It is on fundamental linux commands \s\n the newline character is processed by the echo –e command.
- wc command : The wc (word count) command in Linux operating system is used to find out the number of new lines, word count, byte and characters count in a file indicated by the file parameters.
wc [options] filenames.
$ wc –l readme.txt Shows the result as - 120 readme.txt
wc -l : Prints the number of lines in a file. wc -w : prints the number of words in a file. wc -c : Displays the count of bytes in a file. wc -m : prints the count of characters from a file. wc -L : outputs just the length of the longest line in a file.
- rm : This command is used to delete files in a directory or the directory itself. A directory cannot be deleted if it is not empty.
rm [name of the file]
rm –r removes all the contents in a directory and the directory as well.
$ rm file1 $ rm -r myproject
- find command Similar to the locate command, using find also searches for files and directories. The difference is, you use the find command to locate files within a given directory.
As an example, find /home/ -name notes.txt command will search for a file called notes.txt within the home directory and its subdirectories.
Other variations when using the find are:
To find files in the current directory use, find . -name notes.txt To look for directories use, / -type d -name notes. txt
ping command Use the ping command to check your connectivity status to a server. For example, by simply entering ping google.com, the command will check whether you’re able to connect to Google and also measure the response time.
zip, unzip command Use the zip command to compress your files into a zip archive, and use the unzip command to extract the zipped files from a zip archive.
In conclusion, I believe with my knowledge on linux, I can be able to interact with my computer easily without any stress with the aid of Gitbash. Gitbash is an application software that enables you to interact with your computer with the aid of commands of which such commands are the same with linux commands, so it kinda works hand in hand.