Labels

Files and Directory linux commandline

# cd /home
enter to directory '/ home' [man]

# cd ..
go back one level [man]

# cd ../..
go back two levels [man]

# cd
go to home directory [man]

# cd ~user1
go to home directory [man]

# cd -
go to previous directory [man]

# cp file1 file2
copying a file [man]

# cp dir/* .
copy all files of a directory within the current work directory [man]

# cp -a /tmp/dir1 .
copy a directory within the current work directory [man]

# cp -a dir1 dir2
copy a directory [man]

# cp file file1
outputs the mime type of the file as text [man]

# iconv -l
lists known encodings [man]

# iconv -f fromEncoding -t toEncoding inputFile > outputFile
converting the coding of characters from one format to another [man]

# find . -maxdepth 1 -name *.jpg -print -exec convert
batch resize files in the current directory and send them to a thumbnails directory (requires convert from Imagemagick) [man]

# ln -s file1 lnk1
create a symbolic link to file or directory [man]

# ln file1 lnk1
create a physical link to file or directory [man]

# ls
view files of directory [man]

# ls -F
view files of directory [man]

# ls -l
show details of files and directory [man]

# ls -a
show hidden files [man]

# ls *[0-9]*
show files and directory containing numbers [man]

# lstree
show files and directories in a tree starting from root(2) [man]

# mkdir dir1
create a directory called 'dir1' [man]

# mkdir dir1 dir2
create two directories simultaneously [man]

# mkdir -p /tmp/dir1/dir2
create a directory tree [man]

# mv dir1 new_dir
rename / move a file or directory [man]

# pwd
show the path of work directory [man]

# rm -f file1
delete file called 'file1' [man]

# rm -rf dir1
remove a directory called 'dir1' and contents recursively [man]

# rm -rf dir1 dir2
remove two directories and their contents recursively [man]

# rmdir dir1
delete directory called 'dir1' [man]

# touch -t 0712250000 file1
modify timestamp of a file or directory - (YYMMDDhhmm) [man]

# tree
show files and directories in a tree starting from root(1) [man]