Sunday 7 September 2014

Linux File Commands

  • pwd- Output the current directory that you are in
  • ls - list the content of the current directory
  • ls -a - list all the content, including hidden files
  • ls -l - list the content and its information
  • cd someFolder – change directory to someFolder
  • cd .. - Go up a directory
  • cd - - Return to the previous directory
  • cp source destination – Copy sourceto destination
  • cp -r source destination – Copy a folder recursively from source to destination
  • mv source destination - Move (or rename) a file from source to destination
  • rm someFile- Remove someFile
  • rm -f someFile - Remove someFile without prompt
  • rm -r folder - Remove a folder and its content recursively
  • mkdir foldername – Create a new folder foldername
  • rmdir foldername – Remove an empty folder
  • file someFile – Show the file type of someFile
  • cat file1 file2 – Concatenate file1to file 2
  • cat > someFile – Concatenate standard input to someFile
  • less someFile - View and paginate someFile
  • head someFile - Show first 10 lines of someFile
  • tail someFile - Show last 10 lines of someFile
  • chmod unknown file - Change file permission of file to unknown
  • chown user:group file - Change ownership of fileto userand group group
  • ln -s source destination – Create a link from source to destination

No comments:

Post a Comment