0% found this document useful (0 votes)
4 views

unixcommands

Uploaded by

sail8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

unixcommands

Uploaded by

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

# Create Directory

mkdir
# Remove Directory
rmdir
#remove folder with files
rm -r -f
# Change Directory
cd
# Create new file
vi
#insert data into file
vi
esc i
#Save file
esc :wq enter
# exit without saving changes
esc :q! enter
# open existing file
vi
#remove file
rm
# Move file with same name
mv /
# move file with data appended to filename in the front
mv / /'date+%H%M%d%m%y'
# copy file with same name
cp /
# copy file with new name
cp / /
#print line
echo "your text here to print"
#print date
echo 'date'
#grep � This is one of the most powerful and useful commands available to you in
Linux. It stands for Global/Regular Expression Print. It looks through a file and
prints any line that matches a particular pattern. Because this pattern is based on
"regular expression," a concise line can yield a multitude of patterns to be
matched. For not, though, you can enter a tern for searching.(grep is case
sensitive)
grep pattern_file
#You can use the �-i� flag to make it ignore case.
ls / | grep -i pattern_file
#Piping, or Chaining Piping is so named because it uses the pipe, (| ; shared with
the \ key on most keyboards). Essentially, it takes the output of one command and
directly feeds it to another. You can create long chains of commands to get a very
specific desired output this way, and it�s very convenient for commands like grep.

ls / | grep pattern_file

You might also like