Skip to content

yea-github/Linux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Linux

Print Hello World

$ echo "Hello World"

Create directory

$ mkdir testing

Change directory

$ cd testing

List contents inside a directory

$ ls -l

Find logged in user

$ whoami
$ users
$ who
$ w

Findout used disk space in the system by user

$ df -h

Bring the system down immediately

$ halt

Powers off the system using predefined scripts to synchronize and clean up the system prior to shutting down

$ init 0

Reboots the system by shutting it down completely and then restarting it

$ init 6

Shuts down the system by powering off

$ poweroff

Reboot the system

$ reboot

Shut down the system

$ shutdown

Listing all files

$ ls

Listed files with more information

$ ls -l

List hidden or invisible files

$ ls -a

Create file in Linux

$ vi filename

Display content of a file

$ cat filename

Display file content with line number

$ cat -b filename

Counting words in a file

$ wc filename

Get information about multiple files

$ wc filename1 filename2 filename3

Copying contents from one file to another file

$ cp source_file destination_file

Make a copy of existing file

$ cp filename copyfile

Change the name of existing file

$ mv old_file new_file

Rename the existing file

$ mv file_name new_file

Rename the existing file

$ mv filename newfile

Delete a file

$ rm filename

Remove multiple files at a time

$ rm filename1 filename2 filename3

Create symbolic link to a file name

$ ln -s filename symlink

Create hard link to a filename

$ ln filename hardlink

Got to home directory

$ cd ~

Go to users home directory

$ cd ~username

Got o last directory

$ cd -

Get current full path

$ pwd

List the files in a directory

$ ls dirname
$ ls /usr/local

Create multiple directory

$ mkdir docs pub

Remove directory

$ rmdir dirname

Remove multiple directory

$ rmdir dirname1 dirname2 dirname3

Change directory

$ cd dirname

Rename directory

$ mv old_dir new_dir

Add executive permission of the owner

$ chmod u+x file

Remove write permission from the group

$ chmod g-w file

Set others to read-only (wipes other permissions)

$ chmod o=r file

Give everyone read and write access

$ chmod a+rw file

Give all permissions

$ chmod 777

Owner can edit, others can run

$ chmod 755

Owner can edit, others can only read

$ chmod 644

Only owner can read/write

$ chmod 600

Read only for owner

$ chmod 400

Change ownership of a file

$ chown user filelist

Changing owner of the file

$ chown amrood testfile

Changing group of the file

$ chgrp developers testfile

Assign a String in a variable and print

$ MESSAGE="I LOVE JESUS"
echo $MESSAGE

Using XAMPP in Linux

/opt/lampp/htdocs
sudo mkdir demo-site
sudo chown -R $USER:$USER test-site
cd /opt/lampp
sudo ./xampp start
sudo ./xampp stop
sudo service apache2 stop
cd /opt/lampp
sudo ./manager-linux-x64.run

Install application

sudo dpkg -i packagename.deb

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors