File System

cd

✅ Linux

cd

✅ Windows

cd

Change the directory

Parameters:
cd /
Go to root directory.

cd ..
Go up a directory (parent directory).

cd directory path
Navigate to specified directory.

Example:
cd docs/users
cd "my folder"

pwd/chdir

✅ Linux

pwd

✅ Windows

chdir

(print working directory) - Display the current directory path

Example:
pwd

cat/type

✅ Linux

cat

✅ Windows

type

Short for "concatenate", this command displays file contents in the terminal.

Usage:
cat [option]... file...

Example:
cat myDocument.txt
cat "my document.txt" - quotes must be used when the filename contains a space.
cat file1 file2 file3

ls/dir

✅ Linux

ls

✅ Windows

dir

List all the current files and folders in the current working directory or a specified path.

Options:
-l
    use a long listing format 
-h, --human-readable
    with -l, print file sizes like 1K, 234M, 2G, etc
-a, --all
    do not ignore entries starting with .

Example:
ls
ls path
ls -lah path
ls -a -l path

rm/del

✅ Linux

rm

✅ Windows

del

Short for 'remove'. Deletes a file or directory.

Parameters
-r
Delete a directory and all its contents.

Usage:
rm -r directory name
rm file name
rm file… 

Example:
rm -r myDirectory
rm myFile.txt
rm myFile.txt myfile2.txt

cp/copy

✅ Linux

cp

✅ Windows

copy

Copy a file or directory to another destination file or destination directory.

Usage:
cp source_file dest_file | dest_directory
cp -r source_directory target_directory

Example:
cp passwords.txt docs/myPasswords.txt
cp pass.txt pass2.txt
cp -r myFiles docs

cp "my password.txt" mypass.txt*
*Note if a file or path has spaces in the name it must be surrounded in quotes.