Basic Linux Commands - Basic Linux commands rmdir command...

This preview shows page 1 - 5 out of 20 pages.

Basic Linux commands rmdir command Remove empty directory ( only if empty ) Options: -p Remove directory and its ancestors. mkdir p a/b/c ;rmdir -p a/b/c rm command Remove file(s) and/or directories rm file1 file2 file3 Options: -r: remove directories and their contents recursively rm -r dir1 -f: ignore nonexistent file, never prompt
Basic Linux commands cp command copy file(s) or directoires from one location to another cp file1 file2 /home/friend Options: -i: prompt before overwrite -b : make a backup of each destination file -u : copy only when source file is newer or destinatin file is missing -r: copy directories recursively cp -r ~/dir1 ~/dir2 --parent: append source path in destination directory cp -parent /etc/passwd ~/
Basic Linux commands mv command move file(s)/dir(s) to someplace different mv file1 /dir1 rename file(s) mv file1 file2 Options: -i, -b, -u cat command Display text files to screen cat /etc/fstab Concatenate files cat /etc/fstab /etc/passwd
Basic Linux commands touch command Create a new file touch file1 Change existing file timestamps tree command List contents of directories in a tree-like format Options: -a, -d, -L Not available by default, to have it installed: sudo apt-get install tree

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture