Linux Commands to Know

GDE Error: Error retrieving file - if necessary turn off error checking (404:Not Found)

Create, Copy, & Delete

cp [from] [to]

Copy files/directories from one location to another.

mv [from] [to]

Move files/directories from one location to another. Can also be used for renaming.

rm [options] [file]

Remove files/directories. Wildcards supported for [file].

mkdir [name]

Create a directory.

rmdir [name]

Remove a directory.

touch [name]

Creates the [name] if it does not exist or updates the time stamp.

Display

ls [options]

List files/directories. Commonly used options:
-l = full information
-a = show files who’s name begins with . (aka hidden files)

find dir_to_start_in -name file_to_find -print

Seach for a file. Wildcards accepted.

pwd

Print the current directory path you are in.

df [options]

Show space available on disk. Without options shows for all mounted file systems

du

Show space used by current directory and sub-directories.

Modify Attributes

chown [name] [file]

Change the owner of the files/directories. Wildcards supported for [file].

chgrp [name] [file]

Change the group of the files/directories. Wildcards supported for [file].

chmod [permissions] [dir_or_file]

Change the access permissions of the files/directories. Wildcards supported for
[dir_or_file].
A few common values for [permissions]:
777 = owner [rwx] group [rwx] world [rwx]

775 = owner [rwx] group [rwx] world [r-x]
“Sticky-bits”:
0### = clear all sticky-bits
1### = only owner of file can do things to it
2### = group that “owns” directory will be assigned to all files created inside
4### =

Leave a Reply

Your email address will not be published. Required fields are marked *