Table of contents
No headings in the article.
Before moving on to the list of commands, you need to open the command line first. If you are using windows you can type cmd in search and open the command prompt, in Linux you can press ctrl+alt+t to open a terminal, and in mac In the Finder, open the /Applications/Utility folder, then double-click Terminal
Although the steps may differ depending on the distribution that youβre using, you can usually find the command line in the utility section.
Here are some basic Linux commands for beginners π
1. cd command β‘οΈ
cd command is used to navigate through the Linux files and directories. It requires either the full path or the name of the directory, depending on the current working directory that youβre in.
2.pwd command π
pwd command to find out the path of the current working directory (folder) youβre in.
3. mkdir command π
mkdir command is used to make a new directory.
4. ls command π
ls command is used to view the contents of a directory. By default, this command will display the contents of your current working directory.
There are variations you can use with the ls command:
- ls -R will list all the files in the sub-directories as well
- ls -a will show the hidden files
- ls -al will list the files and directories with detailed information like the permissions, size, owner, etc.
5. touch command βοΈπ
The touch command allows you to create a blank new file through the Linux command line.
6. cp command Β©οΈ
cp command to copy files from the current directory to a different directory.
7. mv command β‘οΈΒ©οΈ
The primary use of the mv command is to move files, although it can also be used to rename files.
8. rmdir command πβ
If you need to delete a directory, use the rmdir command. However, rmdir only allows you to delete empty directories.
9. rm command πβ
The rm command is used to delete directories and the contents within them. If you only want to delete the directory β as an alternative to rmdir β use rm -r(Be careful using this command).
10. cat command πΌπΈ
cat(short for concatenate) is used to list the contents of a file.
Some ways to use the cat command πΌ -
- cat > filename, to create a new file
- cat filename1 filename2>filename, joins two files (1 and 2) and stores the output of them in a new file (3)
This is all, for now, more commands to come in the next blog...stay tuned π