Archive

Archive for June, 2017

Main Linux Commands Easy Guide

June 21st, 2017 No comments

In the previous post, we discussed how to install Linux, now we are going to talk about the most powerful features in Linux which is Linux commands or shell commands.

For the whole documentation of Linux Commands, you can check Linux Documentation.

If you will use Linux, you should know that the power of Linux resides in its shell and the commands that you can use on that shell which gives you the ultimate power.

I’m going to talk about the main Linux commands with their main parameters that you might use daily.

ls Command

List the content of the current directory.

Parameters

–l

to list the content as a detailed list.

-a

Display all files includes hidden files.

You can combine parameters like this:

linux ls command

cd Command

Change directory from the current directory to another one.

Will go to home directory

linux cd command

cp Command

Copy the source to target.

Parameters

-i

Interactive mode means wait for the confirmation if there are files on the target will be overwritten.

-r

Recursive copy means include subdirectories if they found.

Example

linux cp command

mv Command

Move the source to target and remove the source.

Parameters

-i

Interactive mode means wait for the confirmation if there are files on the target will be overwritten.

Example

linux mv command

rm Command

Delete file or directory and you must use –r in case you want to delete a directory.

Parameters

-r

Recursive delete means delete all subdirectories if found.

-i

Interactive means wait till confirmation

linux rm command

mkdir Command

Create new directory

linux mkdir command

rmdir Command

Delete a directory

linux rmdir command

chown Command

Change the ownership of a file or directory to the user you specify.

Parameters

-R

Capital R here means to change ownership of all subdirectories if found and you must use this parameter if you use the command against a directory.

linux chown command

chmod Command

Change the permission of a file or directory.

Parameters

The mode which is divided into 3 parts, ownergroup, and others means what will be the permissions for these modes, and you must specify them.

Every one of the 3 modes takes a permission.

The permission is one of the followings:

Read =4

Write = 2

Execute =1

Every permission represented by a number as shown and you can combine permissions.

Example

That means set permission for the file named myfile as follows:

owner: set it to 7 which means 4+2+1 means read+write+execute.

group: set it to 5 which means 4+1 means read+execute.

other: set it to 5 which means 4+1 means read+execute.

Note: execute for a folder permission means opening it.

linux chmod command

locate Command

To find a file in your system, the locate command will search the system for the pattern you provide.

linux locate command

updatedb Command

updates the database used by the locate command.

date Command

Simply prints today’s date. Just type date on the shell.

tar Command

Combines several files into archive and compression if you want.

Parameters

-c

Create new archive.

-z

Compress the resulting archive using gzip package.

-j

Compress the resulting archive using bzip2 package.

-v

Verbose mode show the processed files.

-f

Write the output to a file and not to screen.

-x

Unpack files from archive.

Example

linux tar command create

This command will pack and compress all files in folder myfiles to a compressed archive named myfiles.tar.gz.

linux tar command extract

This command will decompress the archive.

cat Command

Display file content to screen without limits.

Example

linux cat command

less Command

Displays file content with scroll screen so you can navigate between pages using PgUp, PgDn, Home, and End.

grep Command

Searches for a string in the specified files and displays which line contains the matched string.

Parameters

-R

Recursive search inside subdirectories if found.

-i

Insensitive search and ignore case.

-l

Display file name, not the text lines.

 

Example

linux grep command

passwd Command

Used to change your user password.

linux passwd command

du Command

Calculates the disk usage of a file or a directory.

Parameters

-h

Display human readable form.

-s

Summarize the output total size.

Example

linux du command

reboot Command

Reboot the system immediately. Just type reboot.

halt Command

Shuts down the system, but make sure to close all of your files to avoid data loss.

That was just some of the main Linux commands.

Notice that, if you forget any command parameters,  just type the command with – -help as a parameter and it will list the used parameters so you don’t have to remember all those parameters at the beginning.

cat help

to be continued.

This post was originally published on Like Geeks site here.

Categories: LikeGeeks, Linux Tags:

KWLUG: Saltstack, XMPP (2017-06)

June 7th, 2017 No comments

This is a podcast presentation from the Kitchener Waterloo Linux Users Group on the topic of Saltstack, XMPP published on June 5th 2017. You can find the original Kitchener Waterloo Linux Users Group post here.

To subscribe to the podcast add the feed here or listen to this episode by clicking here or choose from one of the following direct links:

You can find the original Kitchener Waterloo Linux Users Group post here.

Categories: Linux, Podcast, Tyler B Tags: ,