【无标题】

本文介绍了Linux终端下的常用命令如locate、which、find,展示了文件操作、文本处理(如cut、uniq、sort)和数据筛选的过程。关键词涉及文件管理、Linux命令、数据处理和文本分析。
摘要由CSDN通过智能技术生成

[root@localhost ~]# whereis locate

locate: /usr/bin/locate /usr/share/man/man1/locate.1.gz

[root@localhost ~]# which whereis

/usr/bin/whereis

[root@localhost ~]# whereis rm

rm: /usr/bin/rm /usr/share/man/man1/rm.1.gz /usr/share/man/man1p/rm.1p.gz

[root@localhost ~]# find -type f

./.bash_logout

./.bash_profile

./.bashrc

./.cshrc

./.tcshrc

./.cache/dconf/user

./.dbus/session-bus/ac08b2e1885649bda549cb5691432f9b-9

./.config/pulse/ac08b2e1885649bda549cb5691432f9b-device-volumes.tdb

./.config/pulse/ac08b2e1885649bda549cb5691432f9b-stream-volumes.tdb

./.config/pulse/ac08b2e1885649bda549cb5691432f9b-card-database.tdb

./.config/pulse/cookie

./.config/pulse/ac08b2e1885649bda549cb5691432f9b-default-sink

./.config/pulse/ac08b2e1885649bda549cb5691432f9b-default-source

./.esd_auth

./.bash_history

./redirect.txt

./input.txt

./test111.txt

./test_hard.txt

./test_symb.txt

./test1.txt

./pipe_data.txt

./.viminfo

./111.txt

./find111.txt

./.Xauthority

[root@localhost ~]# touch file1

[root@localhost ~]# touch file2

[root@localhost ~]# touch file3

[root@localhost ~]# find file1

file1

[root@localhost ~]# find file2

file2

[root@localhost ~]# find file3

file3

[root@localhost ~]# find -use root

find: unknown predicate `-use'

[root@localhost ~]# find -user root

.

./.bash_logout

./.bash_profile

./.bashrc

./.cshrc

./.tcshrc

./.cache

./.cache/dconf

./.cache/dconf/user

./.dbus

./.dbus/session-bus

./.dbus/session-bus/ac08b2e1885649bda549cb5691432f9b-9

./.config

./.config/ibus

./.config/ibus/bus

./.config/pulse

./.config/pulse/ac08b2e1885649bda549cb5691432f9b-device-volumes.tdb

./.config/pulse/ac08b2e1885649bda549cb5691432f9b-stream-volumes.tdb

./.config/pulse/ac08b2e1885649bda549cb5691432f9b-card-database.tdb

./.config/pulse/cookie

./.config/pulse/ac08b2e1885649bda549cb5691432f9b-default-sink

./.config/pulse/ac08b2e1885649bda549cb5691432f9b-default-source

./.esd_auth

./.bash_history

./redirect.txt

./input.txt

./file1

./file2

./file3

./test2

./test111.txt

./test_hard.txt

./test_symb.txt

./test1.txt

./pipe_data.txt

./.viminfo

./111.txt

./find111.txt

./find112.txt

./.Xauthority

[root@localhost ~]# find -mtime -1

.

./.config/pulse/ac08b2e1885649bda549cb5691432f9b-default-sink

./.config/pulse/ac08b2e1885649bda549cb5691432f9b-default-source

./file1

./file2

./file3

./.Xauthority

[ root@localhost ~]# cat cut_ data .txt

No Na me      Score

1      zhang       20

2      li                80

3      wang        90

4      sun           60  

[ root@localhost ~]#  cut _data.txt

NO

1

2

3

4

[ root@localhost ~] #cut -d " " -f1 cut_data.txt

NO

1  20

2

3  90

4

[ root@localhost ~] #cut -c 1,5 cut_data.txt

Na

La

2

3n

4n

[ root@localhost ~]# vim cut_data2.txt

[ root@localhost ~]# cat cut_data2.txt

No|Name|Score

1|zhang|20

2|li|80

3|wang|90

4|sun|60

[ root@localhost ~]# vim uniq_data.txt

[ root@localhost ~]# cat uniq_data.txt

Welcome to linux

Windows

Windows

Mac

Mac

Linux

[ root@localhost ~]# cat uning _u uniq_data.txt

Welcome to linux

[ root@localhost ~]#vim num.txt

[ root@localhost ~]#vim args.txt

[ root@localhost ~]#cat num.txt

           1

       3 

       5

       2

       4

[ root@localhost ~]#sort -t " " -k2

2  li  80

No Name    score

4   sun   60

3   wang   90

1   zhang  20

[ root@localhost ~]#vim 123

[ root@localhost ~]# cat 123  tr 'm-z' 'M-Z'

abcdefghijklMNOPQRSTUVWXYZ

[ root@localhost ~]#cat 111 | tr '123 456'

Hello          world

[ root@localhost ~]#cat 111 tr -d 'hello world'

123456

[ root@localhost ~]#vim word_count.txt

[ root@localhost ~]#wc -c word_count.txt

49 word_count.txt

[ root@localhost ~]#wc -w word_count.txt

10 word_count.txt

[ root@localhost ~]#wc -l word_count.txt

10 word_count.txt

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值