File commands Flashcards
cd ~
change directory to your home
cd ~luis
change directory to sonali’shome
cd ..
change directory to upper directory
cd /
change directory to root
What are tabs used for?
to finish file names
ctl-d
delete turn off terminal
date
date and time
who am i
Who’s using the machine
‘who’ ‘whoami’
Who’s using the machine
‘ls’
list the files
‘-a’
option means ‘list all’, will show hidden files as wel
all filenames starting with a period are….
Hidden files
‘-l’, ‘–color’ ‘-t’ ‘-lt’ ‘-la’
other commands
‘cat’ or ‘pr’
Printing File
‘mv’
means rename or move
‘cp’
means copy
mkdir
making new directories
rm
removing a file
corresponds to ‘rm’: ‘rm-i’
will ask “are you sure that you want to delete”
corresponds to ‘rm’; ‘rm -r’
will do everything recursivily, ‘-f’ force
rmdir
remove directory
ed
text editor
a
add text
.
stop adding text
w filename
add name to the file
q
exit
wc
word-counting
grep or ‘-v’
search files
sort (‘-r’, ‘-n’, ‘-nr’, ‘-f’)
sort in alphabetical order
chmod 755
rwx rwx rwx
chmod a+r
(u/g/a) ( +/ -) (r/w/x)
file
utility tells type of file like text, word or pdf
what does this do? ‘grep wordpath/filename’
grep find a word in a file
’ | ‘
redirect output of one command to other command
what do these key words show? ‘more’ or ‘less’
shows files pagewise
‘find’ and ‘locate’
utility help to find a file by filename
what does this line do? ‘find –r path –name filename’
will find the location of file in given path. Useful command as we can use wild card pattern