Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

murugan
murugan

Posted on

     

Basic Linux commands for developers

Basic Linux Commands for developers

FILE AND DIRECTORY COMMANDS

S.NoDescriptionCommands
1List all files in a long listing (detailed) formatls -al
2Display the present working directorypwd
3Create a directorymkdir
4Remove (delete) filerm file
5Remove the directory and its contents recursivelyrm -r directory
6Force removal of file without prompting for confirmationrm -f file
7Copy file1 to file2cp file1 file2
8Copy source_directory recursively to destination. If destination exists, copy source_directory into destination, otherwise create destination with the contents of source_directorycp -r source_directory destination
9Rename or move file1 to file2. If file2 is an existing directory, move file1 into directory file2mv file1 file2
10View the contents of filecat file
11Browse through a text fileless file
12Display the first 10 lines of filehead file
12Display the last 10 lines of filetail file

ARCHIVES (TAR FILES)

S.NoDescriptionCommands
1Create tar named archive.tar containing directorytar cf archive.tar directory
2Extract the contents from archive.tartar xf archive.tar
3Create a gzip compressed tar file name archive.tar.gz.tar czf archive.tar.gz directory
4Extract a gzip compressed tar file.tar xjf archive.tar.bz2
5Create a tar file with bzip2 compressiontar cjf archive.tar.bz2 directory
6Extract a bzip2 compressed tar filetar xjf archive.tar.bz2

FILE PERMISSIONS

S.NoDescriptionCommands
1chmod 777 filenamerwx rwx rwx
2chmod 775 filenamerwx rwx r-x
3chmod 755 filenamerwx r-x r-x
4chmod 664 filenamerw- rw- r--
5chmod 644 filenamerw- r-- r--

NETWORKING

S.NoDescriptionCommands
1Display DNS information for domaindig domain
2Display DNS IP address for domainhost domain
4Display all local IP addresses of the host.hostname -I
5Display listening tcp and udp ports and corresponding programsnetstat -nutlp

INSTALLING PACKAGES

S.NoDescriptionCommands
1Search for a package by keywordyum search keyword
2Install packageyum install package
3Display description and summary information about packageyum info package
4Install package from local file named package.rpmrpm -i package.rpm
5Remove/uninstall packageyum remove package

SEARCH

S.NoDescriptionCommands
1Search for pattern in filegrep pattern file
2Search recursively for pattern in directorygrep -r pattern directory
3Find files and directories by namelocate name
4Find files in /home/john that start with "prefix".find /home/john -name 'prefix*'

VIM Exiting

S.NoDescriptionCommands
1write (save) the file, but don’t exit:w
2write out the current file using sudo:w !sudo tee %
3write (save) and quit:wq or :x or ZZ
4quit (fails if there are unsaved changes):q – quit
5quit and throw away unsaved changes:q! or ZQ
6search for pattern/pattern –

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

  • Joined

Trending onDEV CommunityHot

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp