CH8: Working with directories Flashcards
pwd
The tool displays your current directory.
cd
You can change your current directory with the cd command
cd~
will put you in your home directory
cd ..
go to the parent directory
cd .
To stay in the current directory
cd -
go to the previous directory
absolute and relative paths
You should be aware of absolute and relative paths in the file tree. When you type a path starting with a slash (/), then the root of the file tree is assumed. If you don’t start your path with a slash, then the current directory is the assumed starting point.
$PS1
can be configured to show the current directory in the prompt.
ls
to list the content of the current directory
ls -a
Showing all files including the hidden files.
what is a hidden file in linux
it is considered a hidden file and it doesn’t show up in regular file listings
ls -l
ls -l (that is a letter L, not the number 1) gives you a long listing.
ls -lh
shows the numbers (file sizes) in a more human readable format
total 56K
total 56K
drwxr-xr-x 1 aomaf aomaf 4.0K Mar 4 20:12 myepicproject
drwxr-xr-x 1 aomaf aomaf 4.0K Mar 4 19:59 node_modules
-rw-r–r– 1 aomaf aomaf 53K Mar 4 19:59 package-lock.json
-rw-r–r– 1 aomaf aomaf 101 Mar 4 19:59 package.json
drwxr-xr-x 1 aomaf aomaf 4.0K Jun 27 20:41 ransomware
drwxr-xr-x 1 aomaf aomaf 4.0K Mar 4 17:53 solana
drwxr-xr-x 1 aomaf aomaf 4.0K Mar 4 17:51 test-ledger
-rw——- 1 aomaf aomaf 98 Jun 27 20:50 voldamort.py.save
mkdir
Create a directory
-
mkdir stuff
mkdir -p
cerate parent directory as needed