Unix/Linux File Command Reference

Linux is an open-source and free operating system. Open-Source means you can change anything in the operating system, rename it and redistribute with your own name. These redistributions are called “distros”. Few of them are

  • Ubuntu
  • Red Hat
  • Linux Mint
  • Debian
  • Fedora

Did you know? Linux is mostly used as severs. 90% of the servers in the world run on Linux because it is fast, secure and free. The world’s most popular smartphone Android is also made from Linux Kernel. Linux is amazing.

Also, Learn Linux Process Management Commands

Most of the developers or Linux user like to use the CLI(Command Line Interface) rather than GUI(Graphical User Interface) that is what makes Linux amazing. Basic commands to handle files in Unix/Linux terminal. These commands like you in handling files and navigating directories.

CommandResult
ls directory listing
cat > file places standard input into file
cdchange to home
cd dirchange directory to dir
cp -r dir1 dir2copy dir1 to dir2; create dir2 if it
doesn't exist
cp file1 file2copy file1 to file2
head file output the first 10 lines of file
ln -s file linkcreate symbolic link link to file
ls -al formatted listing with hidden files
mkdir dir create a directory dir
more fileoutput the contents of file
mv file1 file2rename or move file1 to file2
if file2 is an existing directory, moves file1 into
directory file2
pwdshow current directory
rm -f fileforce remove file
rm -r dirdelete directory dir
rm -rf dir force remove directory dir *
rm filedelete file
tail -f file output the contents of file as it
grows, starting with the last 10 lines
tail file output the last 10 lines of file
touch filecreate or update file

 

File Permissions Commands

CommandResult
ssh [email protected]connect to host as user
ssh -p port [email protected]connect to host on portport
as user
ssh-copy-id [email protected]
add your key to host for user
to enable a keyed or passwordless login

Leave a Reply