CLI for Beginners
command line is the most popular way of interacting with the OS in the UNIX world every developer should learn these basic commands since it can help you to become more productive and being the part of the community
I learned CLI(Command-line interface) since it is cool. I know you have seen so many movies in which the hacker hacks the entire system just from command line. Isn’t that cool but actually that’s not true? Ok, I understand I got far from the topic and you guys are here to learn the CLI lets Begin.
- ls : this command will list all the contents of the folder
- pwd : so sometimes we are confused in which directory we currently just type pwd it will print the current working directory
- ls -l: this will list all the files and folders in a directory with some additional info such as permission, size, and date, etc
- cd: change-directory this command will change the directory from one directory to other.
cd Desktop : will take us to Desktop
cd ~ or cd / : will take us to the root directory “~” and “/” is used for the home directory.
cd .. : “..” is used for the previous directory basically to go back by one directory
cd Desk : and then press tab it will basically autocomplete the stuff.
#mkdir
#mkdir with sub directories
# touch filename
#touch “file name with space”
cp source destination
change file name during copying
copy recurisively
mv source destination
mv for rename
rm -r to delete recursively means if there is something in the folder and in its sub directories
rf -rf # forcefully means delete the content of the file even if you dont have permisiion
rm will delete the folder completely so there is no chance of getting those files back
I will also create one youtube tutorial on this one so just in case these commands are not clear with you.