0% found this document useful (1 vote)
296 views3 pages

Diy Hacking

The document provides instructions for several common Linux commands. It describes how to use mkdir to create directories, rmdir to delete empty directories, and rm to delete both directories and their contents. The touch command is used to create empty files while man and --help display command manuals or help information. The cp command copies files, mv moves and renames files, and locate searches for files by name.

Uploaded by

sandeep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
296 views3 pages

Diy Hacking

The document provides instructions for several common Linux commands. It describes how to use mkdir to create directories, rmdir to delete empty directories, and rm to delete both directories and their contents. The touch command is used to create empty files while man and --help display command manuals or help information. The cp command copies files, mv moves and renames files, and locate searches for files by name.

Uploaded by

sandeep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

mkdir & rmdir — Use the mkdir command when you need to create

a folder or a directory. For example, if you want to make a directory


called “DIY”, then you can type “mkdir DIY”. Remember, as told
before, if you want to create a directory named “DIY Hacking”, then
you can type “mkdir DIY\ Hacking”. Use rmdir to delete a directory.
But rmdir can only be used to delete an empty directory. To delete a
directory containing files, use rm.

5. rm - Use the rm command to delete files and directories.  Use "rm


-r" to delete just the directory. It deletes both the folder and the files it
contains when using only the rm command.

6. touch — The touch command is used to create a file. It can be


anything, from an empty txt file to an empty zip file. For example,
“touch new.txt”.

7. man & --help — To know more about a command and how to use
it, use the man command. It shows the manual pages of the
command. For example, “man cd” shows the manual pages of
the cd command. Typing in the command name and the argument
helps it show which ways the command can be used (e.g., cd –help).

8. cp — Use the cp command to copy files through the command line.


It takes two arguments: The first is the location of the file to be
copied, the second is where to copy.

9. mv — Use the mv command to move files through the command


line. We can also use the mv command to rename a file. For example,
if we want to rename the file “text” to “new”, we can use “mv text
new”. It takes the two arguments, just like the cp command.
10. locate — The locate command is used to locate a file in a Linux
system, just like the search command in Windows. This command is
useful when you don't know where a file is saved or the actual name
of the file. Using the -i argument with the command helps to ignore
the case (it doesn't matter if it is uppercase or lowercase). So, if you
want a file that has the word “hello”, it gives the list of all the files in
your Linux system containing the word "hello" when you type in
“locate -i hello”. If you remember two words, you can separate them
using an asterisk (*). For example, to locate a file containing the
words "hello" and "this", you can use the command “locate -i
*hello*this”.

Intermediate Commands

1. echo — The "echo" command helps us move some data, usually


text into a file. For example, if you want to create a new text file or
add to an already made text file, you just need to type in, “echo hello,
my name is alok >> new.txt”. You do not need to separate the spaces
by using the backward slash here, because we put in two triangular
brackets when we finish what we need to write.

You might also like