Linux Guide/File Manipulation

< Linux Guide
Previous Up Next

ls 
lists all files and directories in the current directory.
mv <file> <to> 
move <file> to destination <to>.
rm <file> 
remove <file>.
cd <dir> 
change the current directory to <dir>.
cat <file> 
concatenate files and show them on standard output, text files work best:)
find [path...] [expression] 
search for files in the given path
xargs <command> 
takes input from stdin and formats it as the arguments to another program. For instance, to delete all files with an ending ~, write find . -name "*~" | xargs rm

Copy file from remote system (rsync)

rsync -ave ssh <remote_server>:<source_path> <dest_dir>

Example:

rsync -ave ssh root@192.168.1.252:/tmp/myfile .

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.