Cyber Security · मराठी आवृत्ती
Terminal मध्ये navigation
तुमच्या Linux lab वर login करा आणि commands एकेक करून चालवा. आधी आपण कुठल्या directory मध्ये आहोत ते पाहू.
| Command | अर्थ | Example |
|---|---|---|
pwd |
Current directory चा path दाखवणे | pwd → /home/ubuntu |
ls |
Files ची list | ls, ls -l, ls -la, ls -lh /var/log |
cd |
Directory बदलणे | cd /etc, cd .., cd ~, cd - |
tree |
Folder tree दाखवणे (tree package लागतो) | tree -L 2 /etc/nginx |
clear |
Screen साफ करणे (किंवा Ctrl+L) | |
history |
आधी चालवलेल्या commands | history | tail -20, then !45 to re-run no. 45 |
pwd # where am I?
ls -la # long listing including hidden files (starting with .)
cd /var/log # absolute path (starts with /)
cd ../www # relative path (.. = parent, . = current)
cd ~ # go to home directory (same as just 'cd')
cd - # go back to the previous directory
pwd current path दाखवतो. ls -la long listing सोबत dot ने सुरू होणाऱ्या hidden files दाखवतो. / ने सुरू होणारा path absolute असतो; current directory वर अवलंबून असणारा path relative असतो. .. म्हणजे parent आणि . म्हणजे current directory. cd ~ किंवा फक्त cd home मध्ये नेतो; cd - मागच्या directory मध्ये नेतो. Example मधला /var/www folder नसेल तर त्या step ला error येणं स्वाभाविक आहे.
ls -l चं output वाचूया
-rw-r--r-- 1 ec2-user ec2-user 1024 Mar 3 10:15 notes.txt
│└──┬───┘ │ └──┬───┘ └──┬───┘ └┬─┘ └─────┬────┘ └───┬───┘
│ permissions links owner group size modified time name
└─ type: - file, d directory, l symbolic link
पहिला character type दाखवतो: - file, d directory, l symbolic link. नंतर permissions, link count, owner, group, size, modified time आणि नाव दिसतं.
काम सोपं करणारे shortcuts
- Tab: command/file name पूर्ण करण्यास मदत. दोनदा दाबल्यावर पर्याय दिसू शकतात.
- ↑ / ↓: आधीच्या commands पाहणे.
- Ctrl+C: चालू command ला interrupt.
- Ctrl+R: command history मध्ये search.
- Ctrl+A / Ctrl+E: line च्या सुरुवातीला/शेवटी जाणे.
- Ctrl+L किंवा
clear: screen साफ करणे.
tree package directory tree दाखवतो. history आधीच्या commands दाखवतो. !45 सारखा history expansion command पुन्हा चालवतो; चालवण्याआधी तो काय आहे ते तपासा.
Practice
Home मधून /var/log, मग /etc/ssh, मग cd - ने मागे आणि शेवटी cd ने home मध्ये जा. प्रत्येक step नंतर pwd चालवा.