Basic Commands Flashcards
(17 cards)
rm
remove (delete) a file
- -r is used for recursive (use rm -r to remove a directory)
rmdir
remove (delete) a directory (use rm -r if the directory contains files)
cd
change directory to move around the file structure
. (dot)
current directory
.. (dot dot)
parent directory
ls
list the contents of a directory
- -l (prints long form of the file list)
- -a (show all files, including hidden files)
touch
create a new file
less
read the contents from a file
nano
a command line text editor
ln
link a file
- -s (creates a softlink)
cp
copy a file
Syntax: (cp file1 file2)
mkdir
make a new directory
clear
Clears the terminal prompt screen
pwd
print working directory (displays where you are in the filesystem)
cat
concatenate and print files
find
finds a file based on some criteria
Syntax: find [which directory] [-argument]
- -type
- -name
- -size
- -mtime (modified time)
- -atime (accessed time)
- -ctime (created time)
grep
searches contents in a file based on a specified pattern
Syntax: grep [pattern] [filename]
- -i (option for case-insensitive)