Showing posts with label Command Line References. Show all posts
Showing posts with label Command Line References. Show all posts

Sunday, November 18, 2007

Linux/UNIX Basic Commands - Part 2

Hi Friends,

Here is the continuation of the topic Linux/UNIX Basic Commands Part 1.

SSH:

ssh user@host – connect to host as user
ssh -p port user@host – connect to host on port as user
ssh-copy-id user@host – add your key to host for user to enable a keyed or passwordless login

Searching:

grep pattern files – search for pattern in files
grep -r pattern dir – search recursively for pattern in dir
command | grep pattern – search for pattern in the output of command
locate file – find all instances of file

Compression:

tar cf file.tar files – create a tar named file.tar containing files
tar xf file.tar – extract the files from file.tar
tar czf file.tar.gz files – create a tar with Gzip compression
tar xzf file.tar.gz – extract a tar using Gzip
tar cjf file.tar.bz2 – create a tar with Bzip2 compression
tar xjf file.tar.bz2 – extract a tar using Bzip2
gzip file – compresses file and renames it to file.gz
gzip -d file.gz – decompresses file.gz back to file

Network:

ping host – ping host and output results
whois domain – get whois information for domain
dig domain – get DNS information for domain
dig -x host – reverse lookup host
wget file – download file
wget -c file – continue a stopped download

Installation

Install from source:
./configure
make
make install
dpkg -i pkg.deb – install a package (Debian)
rpm -ivh pkg.rpm – install a package (RPM)
yum install pkgname - using the yum tool

Shortcuts:

Ctrl+C – halts the current command
Ctrl+Z – stops the current command, resume with fg in the foreground or bg in the background
Ctrl+D – log out of current session, similar to exit
Ctrl+W – erases one word in the current line
Ctrl+U – erases the whole line
Ctrl+R – type to bring up a recent command
!! - repeats the last command
exit – log out of current session

Thanks

Logu
logu_microsoft@hotmail.com
91-98414-99143

Linux/UNIX Basic Commands - Part 1

Hi friends

Please find the Basic linux/Unix commands below for your reference

File Commands:

ls – directory listing
ls -al – formatted listing with hidden files
cd dir - change directory to dir
cd – change to home
pwd – show current directory
mkdir dir – create a directory dir
rm file – delete file
rm -r dir – delete directory dir
rm -f file – force remove file
rm -rf dir – force remove directory dir *
cp file1 file2 – copy file1 to file2
cp -r dir1 dir2 – copy dir1 to dir2; create dir2 if it doesn't exist
mv file1 file2 – rename or move file1 to file2 if file2 is an existing directory, moves file1 into directory file2
ln -s file link – create symbolic link link to file
touch file – create or update file
cat > file – places standard input into file
more file – output the contents of file
head file – output the first 10 lines of file
tail file – output the last 10 lines of file
tail -f file – output the contents of file as it grows, starting with the last 10 lines.

System Info:

date – show the current date and time
cal – show this month's calendar
uptime – show current uptime
w – display who is online
whoami – who you are logged in as
finger user – display information about user
uname -a – show kernel information
cat /proc/cpuinfo – cpu information
cat /proc/meminfo – memory information
man command – show the manual for command
df – show disk usage
du – show directory space usage doesn't exist
free – show memory and swap usage
whereis app – show possible locations of app
which app – show which app will be run by default
locate filename - to find the location of the file
find / -name filename or namespace - to find the file with some namespace

Process Management:

ps – display your currently active processes
top – display all running processes
kill pid – kill process id pid
killall proc – kill all processes named proc *
bg – lists stopped or background jobs; resume a stopped job in the background
fg – brings the most recent job to foreground
fg n – brings job n to the foreground

File Permissions:

chmod octal file – change the permissions of file to octal, which can be found separately for user, group, and world by adding:
  • 4 – read (r)
  • 2 – write (w)
  • 1 – execute (x)
Examples:
chmod 777 – read, write, execute for all
chmod 755 – rwx for owner, rx for group and world
For more options, see man chmod.

Please read Linux/UNIX Basic Commands - Part 2 also.

Thanks

Logu
logu_microsoft@hotmail.com
91-9841499143

Saturday, October 13, 2007

Windows Shortcut Run Commands:

Hi friends,

I have seen many system administrator use to work fast while using their desktops and used to admire it. They never use mouse or surf through the start menu for reaching the particular application. So this article gives you the idea about the shortcuts for the run commands.

Working of Run Commands:

Each and every application will be having a executable file for its application and the respective core content will be stored in some executable path. Initially PATH variable will be set in the environmental variable settings tab.
(in my PC, it may have more values also in your PC)
$PATH = C:\Program Files\Support Tools\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\WBEM;
C:\WINNT\Microsoft.NET\Framework\v2.0.50727;C:\sbin\svn\bin;C:\Program Files
\QuickTime\QTSystem\

Creating Shortcuts:

Creating shortcuts of your wish for particular application and for folders or files is also possible. Let me give a quick example suppose you want to create a shortcut for particular folder in some path.

1. Create folder say c:\shortcuts
2. Open Environmental settings tab of your computer and add "c:\shortcuts" to $PATH.
3. Right Click the folder you want to make shortcuts and create shortcut.
4. Rename the shortcut if you wish.
5. Paste the shortcut into "c:\shortcuts"

To test Open --> Run --> "shortcut name" . It will open the folder for which we have created the shortcut before.

Some Windows Run Commands:

  1. Accessibility Controls - access.cpl
  2. Add Hardware Wizard - hdwwiz.cpl
  3. Add/Remove Programs - appwiz.cpl
  4. Administrative Tools - control admintools
  5. Automatic Updates - wuaucpl.cpl
  6. Bluetooth Transfer Wizard - fsquirt
  7. Calculator - calc
  8. Certificate Manager - certmgr.msc
  9. Character Map - charmap
  10. Check Disk Utility - chkdsk
  11. Clipboard Viewer - clipbrd
  12. Command Prompt - cmd
  13. Component Services - dcomcnfg
  14. Computer Management - compmgmt.msc
  15. timedate.cpl - ddeshare
  16. Device Manager - devmgmt.msc
  17. Direct X Control Panel (If Installed)* - directx.cpl
  18. Direct X Troubleshooter - dxdiag
  19. Disk Cleanup Utility - cleanmgr
  20. Disk Defragment - dfrg.msc
  21. Disk Management - diskmgmt.msc
  22. Disk Partition Manager - diskpart
  23. Display Properties - control desktop
  24. Display Properties - desk.cpl
  25. Display Properties (w/Appearance Tab Preselected) - control color
  26. Dr. Watson System Troubleshooting Utility - drwtsn32
  27. Driver Verifier Utility - verifier
  28. Event Viewer - eventvwr.msc
  29. File Signature Verification Tool - sigverif
  30. Findfast - findfast.cpl
  31. Folders Properties - control folders
  32. Fonts - control fonts
  33. Fonts Folder - fonts
  34. Free Cell Card Game - freecell
  35. Game Controllers - joy.cpl
  36. Group Policy Editor (XP Prof) - gpedit.msc
  37. Hearts Card Game - mshearts
  38. Iexpress Wizard - iexpress
  39. Indexing Service - ciadv.msc
  40. Internet Properties - inetcpl.cpl
  41. IP Configuration (Display Connection Configuration) - ipconfig /all
  42. IP Configuration (Display DNS Cache Contents) - ipconfig /displaydns
  43. IP Configuration (Delete DNS Cache Contents) - ipconfig /flushdns
  44. IP Configuration (Release All Connections) - ipconfig /release
  45. IP Configuration (Renew All Connections) - ipconfig /renew
  46. IP Configuration (Refreshes DHCP & Re-Registers DNS) - ipconfig /registerdns
  47. IP Configuration (Display DHCP Class ID) - ipconfig /showclassid
  48. IP Configuration (Modifies DHCP Class ID) - ipconfig /setclassid
  49. Java Control Panel (If Installed) - jpicpl32.cpl
  50. Java Control Panel (If Installed) - javaws
  51. Keyboard Properties - control keyboard
  52. Local Security Settings - secpol.msc
  53. Local Users and Groups - lusrmgr.msc
  54. Logs You Out Of Windows - logoff
  55. Microsoft Chat - winchat
  56. Minesweeper Game - winmine
  57. Mouse Properties - control mouse
  58. Mouse Properties - main.cpl
  59. Network Connections - control netconnections
  60. Network Connections - ncpa.cpl
  61. Network Setup Wizard - netsetup.cpl
  62. Notepad - notepad
  63. Nview Desktop Manager (If Installed) - nvtuicpl.cpl
  64. Object Packager - packager
  65. ODBC Data Source Administrator - odbccp32.cpl
  66. On Screen Keyboard - osk
  67. Opens AC3 Filter (If Installed) - ac3filter.cpl
  68. Password Properties - password.cpl
  69. Performance Monitor - perfmon.msc
  70. Performance Monitor - perfmon
  71. Phone and Modem Options - telephon.cpl
  72. Power Configuration - powercfg.cpl
  73. Printers and Faxes - control printers
  74. Printers Folder - printers
  75. Private Character Editor - eudcedit
  76. Quicktime (If Installed) - QuickTime.cpl
  77. Regional Settings - intl.cpl
  78. Registry Editor - regedit
  79. Registry Editor - regedit32
  80. Remote Desktop - mstsc
  81. Removable Storage - ntmsmgr.msc
  82. Removable Storage Operator Requests - ntmsoprq.msc
  83. Resultant Set of Policy (XP Prof) - rsop.msc
  84. Scanners and Cameras - sticpl.cpl
  85. Scheduled Tasks - control schedtasks
  86. Security Center - wscui.cpl
  87. Services - services.msc
  88. Shared Folders - fsmgmt.msc
  89. Shuts Down Windows - shutdown
  90. Sounds and Audio - mmsys.cpl
  91. Spider Solitare Card Game - spider
  92. SQL Client Configuration - cliconfg
  93. System Configuration Editor - sysedit
  94. System Configuration Utility - msconfig
  95. System File Checker Utility (Scan Immediately) - sfc /scannow
  96. System File Checker Utility (Scan Once At Next Boot) - sfc /scanonce
  97. System File Checker Utility (Scan On Every Boot) - sfc /scanboot
  98. System File Checker Utility (Return to Default Setting) - sfc /revert
  99. System File Checker Utility (Purge File Cache) - sfc /purgecache
  100. System File Checker Utility (Set Cache Size to size x) - sfc /cachesize=x
  101. System Properties - sysdm.cpl
  102. Task Manager - taskmgr
  103. Telnet Client - telnet
  104. User Account Management - nusrmgr.cpl
  105. Utility Manager - utilman
  106. Windows Firewall - firewall.cpl
  107. Windows Magnifier - magnify
  108. Windows Management Infrastructure - wmimgmt.msc
  109. Windows System Security Tool - syskey
  110. Windows Update Launches - wupdmgr
  111. Windows XP Tour Wizard - tourstart
  112. Wordpad - write
  113. Microsoft Outlook - Outlook
  114. Microsoft Word - Winword
  115. Acrobat Reader - Acrord32
  116. Active Dir Users and Comp - Dsa.msc
  117. Routing and remote access - Rrasmgmt.msc
  118. DNS - Dnsmgmt.msc
  119. Add/remove Programs - Appwiz.cpl
  120. Display property - Desk.cpl
Thanks

Logu
logu_microsoft@hotmail.com
91-98414-99143