Home > Linux > Learn basics of Linux hacking for hacking aspirants Part 2

Learn basics of Linux hacking for hacking aspirants Part 2

linux file commands

In the previous part I gave a little basic for using linux file commands. This part will be on creating & working on directories. After reading & practicing these command you will b able to work with files & directories. This will help you when you will be executing scripts.

Learn Linux File commands

Learn every variation of these basic linux file commands. You be exploring the files directories in some days. You should be mastered in using these file commands

Cd Command

This command was discussed earlier. Change directory is used in many variations.In the previous article we used the cd command as cd..Another variation is cd/ by which you can go to root directory, cd~ is used for moving in home directory.

Cd command is also used to move a directory from one location to other. You can use cd command to move to any directory by writing the location specifically. For ex. cd/abc/def/new-folder. Make sure Linux is a case sensitive OS , your spelling must be correct & exact letters are used. If any letter is written wrong then error message will be displayed.

One more way to use cd command is cd hackbook. Now as we are new-folder & hackbook is sub-directory in it then without writing the whole path again just write the name of subdirectory in it.

Listing command

List command will tell you all the contents that are inside a directory. This command can be used as ls. It will show you all the contents that are inside the current directory.

Also Read : Top Books to learn hacking in 2017

This ls command can be used with two switches. These switches are -a & -l. The command ls-a will show all the content inside the directory with all the hidden files too. Next ls-l , this -l will provide all the details of file  like permissions, size , group & date of creation.

Both can be used at same time also. Like this ls-la , this will show the details of hidden files also. We will be knowing about the permissions in the next article.

linux file commands
linux file commands

Touch Command

Command to create a new file in Linux. It is used as touch newfile. We can check the details of this new file by using the command ls-la. After this command a long list will be displayed

Make new directory

To make a new directory use mkdir command. write mkdir directory name & press enter. You directory will be created in the current directory.

Use Help to know more about commands

To get the manual for using the commands in linux. Man is the command that can help you to know about the commands. You can use the man command to know for any command. For example man cd. THis will provide you the way by which this command can be used by someone.

One more way to use manual is to use -h or –help in any command . This will also work as same as the man command works. For ex cd–help. It will provide all  ways to use this cd command.

For now this is over. I hope you will practice all these commands nicely . Remember the commands, this will be used very soon.

Also Read : Learn basics of Linux hacking part 1

Please give us feedback for this series. Write comments in the comments section to let me know. Like our Facebook for more updates.

Vanshanu raj
Vanshanu Raj is Computer Science Graduate from College of Engineering Roorkee & a Diploma Holder from Government Polytechnic Dehradun. He lives in Dehradun working as a security engineer in a mid sized IT company. I Made this site to to aware people with Open Source Software & their uses.

Leave a Reply

Your email address will not be published. Required fields are marked *