|
Here's how: grep 'word you want to search' 'file to browse' For example, suppose you want to find the word “photosynthesis” in the file “biologi.txt”. Then, you can type the following command: grep photosynthesis biologi.txt As a result, you will see a line containing the word “photosynthesis” in the file. 16. du Do you want to know how much disk space is already occupied in a directory? You can get the answer via the du command . Here's how to use it: du -h directory name For example, suppose you want to know the total size ( size ) of content in the /home/user/downloads directory, then you would type: du -h /home/user/downloads .
You only need to type the df command . The results will be displayed in kilobytes. However, if you want to view it in megabytes, you can write df -m . 18. diff This basic Linux command is very useful Uk Phone Number List for programmers. Because, the diff command can be used to compare the content in two different files. That way, the programmer can check whether there is a different code in the two files. For example, suppose they want to know if there are any code differences in file1.txt and file2.txt . They only need to type in the following command: diff file1.txt file2.txt 19. heads This command is used to display the first ten lines of text in a file.

For example, suppose you wanted to see the first ten lines in the file revision1.txt , then you would write: head revision1.txt However, you can also set the number of rows displayed. You do this by adding the "-n number of lines" component in the middle of the command. So if you want to see just three lines, you can type: head -n 3 revision1.txt 20. tails Tail is the opposite of head. Because this command will display the last ten lines of text in a file. So, if you want to see the last ten lines of the revision2.txt file , you just have to type: tail revision2.txt And if you want to see only the last three lines, you can write: tail -n 3 revision2.txt 21. tar The tar command is more or less functional like WinRar or 7Zip.
|
1、在论坛里发表的文章仅代表作者本人的观点,与本网站立场无关。
2、论坛的所有内容都不保证其准确性,有效性,时间性。阅读本站内容因误导等因素而造成的损失本站不承担连带责任。
3、当政府机关依照法定程序要求披露信息时,论坛均得免责。
4、若因线路及非本站所能控制范围的故障导致暂停服务期间造成的一切不便与损失,论坛不负任何责任。
5、注册会员通过任何手段和方法针对论坛进行破坏,我们有权对其行为作出处理。并保留进步追究其责任的权利。
|