0% found this document useful (0 votes)
18 views3 pages

Working With Files

The document provides instructions for common Linux commands for system information, file management, directory management, and copying/moving files. It includes commands for viewing username, date, calendar, kernel version, hostname, connected users, switching users, clearing screen, and getting command help. Commands are presented for creating, appending to, deleting, and viewing files and directories, as well as copying, moving, and hiding files.

Uploaded by

harish
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views3 pages

Working With Files

The document provides instructions for common Linux commands for system information, file management, directory management, and copying/moving files. It includes commands for viewing username, date, calendar, kernel version, hostname, connected users, switching users, clearing screen, and getting command help. Commands are presented for creating, appending to, deleting, and viewing files and directories, as well as copying, moving, and hiding files.

Uploaded by

harish
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

1)logname: it shows current username

2)pwd: Present working directory which means current folder in linux

3)date: it display system date and time

4)clear: to clear the screen

5)cal: current month calendar we can call month and year along with cal
command ex: cal 5 1984 which displays may month 1984

6)uname: os name

7)uname -r: displays kernal version

8)hostname: displays server name

9)hostname -i: display server ip address

10)who: it shows list of connect user in that server

11)who am i: current logged user info

12)su: switch username from one user into another user ex:su - username

13)exit: logout from current user logged in

14)man command name: help of the given command

WORKING WITH FILES:

1)cat: which is use to create a new file or open to view existing files

2)cat>>filename: appending data to these file

3)$touch filename: which create an empty file with zero kb

FILE DELETION:

1)rm: to delete the file

2)rm -rf: delete the files forcibly


3)rm -i: delete the file with user conformation

4)rm file1 file2: deleting multiple files

WORKING WITH DIRECTORIES:

1)mkdir: to create a new directory (Directory is nothing but a drive or folders)


in linux

2)cd dirname: to change a directory

3)cd .. : to moves from current directory into previous directory

4)cd: to come out entire directory

5)cd /: it changes the root directory

REMOVING DIRECTORIES:

1)rmdir: to removing directory it must be empty

2)rm -r direcname: it deletes recursively to entire structure

3)rm -ri direcname: it deletes recursively to entire structure with user


conformation

4)rm -rf direcname: it deletes recursively to entire structure with forcibly

COPY COMMANDS

1)cp sourcefile targetfile: copying file from existing location into new location

MOVING COMMANDS

1)mv old file newlocation: using these command we can move a file from one
folder into another folder or we can rename file also

VIEWING FILE COMMANDS

1)ls : it's listing files which are in that directory with ascending order

2)ls -a: listed all files including hidden files also


3)ls -l: listed all files in long list format i.e 9 field

4)ls -t: listed all files based on date and time of creation

5)ls -r: listed all files on descending order or sin reverse

6)ls -R: listed all files recursively

CREATING HIDDEN FILES

1)cat>.filename

2)mv filename .filename

3)mkdir .dirname

UNHIDE FILES

1)mv .emp emp

2)mv .dirname dirname

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy