DQ - BASH Flashcards
Listing the non-hidden contents of the current directory without any options
ls
Listing the non-hidden contents of path /home/dq
ls /home/dq
Listing the non-hidden contents of the current directory in long format
ls -l
Listing all contents of the current directory
ls -a
Listing all contents of /home/dq in long format, except for the directories . and ..
ls -Al
Change to directory /filename
cd /filename
Change to the parent directory of the current directory
cd ..
Change to the parent directory of the parent directory of the current directory
cd ../..
Change to your home directory
cd
OR
cd ~
Change to the home directory of user dq
cd ~dq
Change to the previous directory
cd -
Creating a directory called my_dir
mkdir my_dir
Deleting an empty directory called my_dir
rmdir my_dir
Interactively creating a copy of file my_file1 as my_file2
cp -i my_file1 my_file2
Create a copy of directory my_dir1 as my_dir2
cp -R my_dir1 my_dir2
Deleting file my_file
rm my_file
Deleting the non-empty directory my_dir
rm -R my_dir
Moving my_file to my_dir
mv my_file my_dir
Renaming my_file as our_file
mv my_file our_file
Wildcard to match any single character
?
Wildcard to match any multitude of string characters
*
Wildcard to match k,3, z, or J
[k3zJ]
Wildcard matching any character NOT in k,3, z, or J
[!k3zJ]
Wildcard for letters (case insensitive)
[[:alpha:]]
Wildcard for numbers
[[:digit:]]
Wildcard for letters or numbers
[[:alnum:]]
Wildcard for lowercase letter
[[:lower:]]
Wildcard for uppercase letter
[[:upper:]]
All files whose name is three characters long
???
All files ending with .tsv
*.tsv