Working with Basic Linux commands -Part 2

Posted by

We are back again with another Linux command tutorial. This will be the last part of Linux Basic commands. In case you missed it Working with Basic Linux command part-1.

File creation, Traversing and Editing

echo“- Echo command is used to create a file with text in it.

echo"TEXT" > [file_name]
echo

“cat”- cat command is used to print the data from file.

cat [file_name]
cat

“nano”- nano is a built in text editor that can be used to edit text in terminal.

nano [file_name]

File compression and decompression

In Linux we can compress directories and files with “tarball”

“tar”- tar command is used to compress a file.

Options-

  • -c: Create an archive.
  • -z: Compress the archive with gzip.
  • -v: Display progress in the terminal while creating the archive, also known as “verbose” mode. The v is always optional in these commands, but it’s helpful.
  • -f: Allows you to specify the filename of the archive.
  • -x: Allows you to decompress a file.
tar [options] [archived_file_name.tar.gz] [file_name]

tar compression

tar compression

tar decompression

decompression

App installation

“apt”- apt command installs applications.

Updating repositories- sudo apt-get update
App installation- sudo apt-get install [package_name] 
app installation

Copying and Moving file

“cp” – cp command copies a file from one directory to another.

cp [file_path] [target_path]
copying a file

“mv”- mv command moves a file from one directory to another.

mv [file_path] [target_path]
moving a file

Comment below for feedback. We will be back with more commands.

Linux-Commands Part 1

One comment

Leave a Reply

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