| Command | What it does | What it takes | Flags |
|---|---|---|---|
| pwd | Prints working directory | - | |
| cd | Changes directory | New directory to change to | |
| mkdir | Makes a directory | It first takes the new name, and then the directory you want to create this new directory in | todo read up on the flag -p |
| cp (what an unfortunate name) | Copies files in many ways | cp myfile newname duplicates the file and renames itcp file1 fil2 B09 takes in several files and copies it into a directorycp -R /home/krish /tmp/mystuff takes two directories, fully copies one directory into the other. todo Play with these they seem very important | -a or --archive copies the ownership / permission of the files into the new file (by default it copies the default attributes of the user)-i or --interactive makes you ask for confirmation (otherwise files can be overwritten with no remorse)-r recursive (copies directories AND their contents). Required when copying directories-u or --update will only copy files that don’t exist or can be updated. Basically it “skips” already existing files-v or --verbose prints all sorts of great info while copying |
mv | ”Move” (Renames files or moves files to another directory) can be used like mv file1 dir2or mv file1 file2 for renaming | For rename:mv myfile renamedfileFor moving: mv myfileordirectory newdirectoryIf the directory dir2 does not exist, it will create it for you. | |
rm | Removes a file | A file or directory, but it won’t delete a directory unless you call something like rm -r /home/krishtodo uhhh | |
rmdir | Removes a directory (checks if it’s empty first though) | A directory |
Other commands
touch | Creates a file | A name | |
|---|---|---|---|