- Linux Admin Tutorial
- Home
- CentOS Overview
- Basic CentOS Linux Commands
- File / Folder Management
- User Management
- Quota Management
- Systemd Services Start and Stop
- Resource Mgmt with systemctl
- Resource Mgmt with crgoups
- Process Management
- Firewall Setup
- Configure PHP in CentOS Linux
- Set Up Python with CentOS Linux
- Configure Ruby on CentOS Linux
- Set Up Perl for CentOS Linux
- Install and Configure Open LDAP
- Create SSL Certificates
- Install Apache Web Server CentOS 7
- MySQL Setup On CentOS 7
- Set Up Postfix MTA and IMAP/POP3
- Install Anonymous FTP
- Remote Management
- Traffic Monitoring in CentOS
- Log Management
- Backup and Recovery
- System Updates
- Shell Scripting
- Package Management
- Volume Management
- Linux Admin Useful Resources
- Linux Admin - Quick Guide
- Linux Admin - Useful Resources
- Linux Admin - Discussion
Linux Admin - tee Command
tee is a simple command, letting an administrator write command output and view a file at the same time. This simple command can save time over first writing stdout to a file, then viewing the file contents.
Following are the common Switches used with tee.
Command | Action |
---|---|
-a | Append to files instead of clobber file |
-i | Ignore interrupts (for advanced use in scripting mostly) |
Without tee to both view and write files and directories in /etc, where each begins with the letter "a".
[root@centosLocal Documents]# ls -d /etc/a* /etc/abrt /etc/aliases.db /etc/anacrontab /etc/at-spi2 /etc/autofs.conf /etc/auto.master.d /etc/auto.smb /etc/adjtime /etc/alsa /etc/asound.conf /etc/audisp /etc/autofs_ldap_auth.conf /etc/auto.misc /etc/avahi /etc/aliases /etc/alternatives /etc/at.deny /etc/audit /etc/auto.master /etc/auto.net [root@centosLocal Documents]# ls -d /etc/a* > ./etc_report_a.txt [root@centosLocal Documents]# cat ./etc_report_a.txt /etc/abrt /etc/adjtime /etc/aliases /etc/aliases.db /etc/alsa /etc/alternatives /etc/anacrontab /etc/asound.conf /etc/at.deny /etc/at-spi2 /etc/audisp /etc/audit /etc/autofs.conf /etc/autofs_ldap_auth.conf /etc/auto.master /etc/auto.master.d /etc/auto.misc /etc/auto.net /etc/auto.smb /etc/avahi [root@centosLocal Documents]#
This small task is much more efficient with the tee command.
[root@centosLocal Documents]# ls -d /etc/a* | tee ./etc_report_a.txt /etc/abrt /etc/adjtime /etc/aliases /etc/aliases.db /etc/alsa /etc/alternatives /etc/anacrontab /etc/asound.conf /etc/at.deny /etc/at-spi2 /etc/audisp /etc/audit /etc/autofs.conf /etc/autofs_ldap_auth.conf /etc/auto.master /etc/auto.master.d /etc/auto.misc /etc/auto.net /etc/auto.smb /etc/avahi [root@centosLocal Documents]#
basic_centos_linux_commands.htm
Advertisements
To Continue Learning Please Login
Login with Google