Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ grep search from files and display the file name     - Oracle table compression Technology Introduction (Database)

- GDB remote connections RX Probe online debug program (Programming)

- Installation Flow N Play- interface stylized video player on Ubuntu (Linux)

- Error: Unable to establish connection with FTP SFTP server (Server)

- IOS interview questions Summary (Programming)

- FFmpeg compiled with only H264 decoding library (Programming)

- Linux command execution judge sentences -;, &&, || (Linux)

- MySQL DATE_FORMAT () function (Database)

- Linux users should be aware that should the 7 ls command unique skills (Linux)

- Android screen rotation processing and ProgressDialog the best AsyncTask (Programming)

- Based on OpenSSL for HTTPS service configuration (Server)

- numpy and SciPy installation under Python for scientific computing package (Linux)

- Several SQL Server data migration / Export Import Practice (Database)

- Shilpa Nair interview experience sharing RedHat Linux package management (Linux)

- OpenGL Superb Learning Notes - Depth Texture and Shadows (Programming)

- How to view information about the installed version of CentOS (Linux)

- Cobbler batch install Ubuntu / CentOS system (Linux)

- Change CentOS 7 NIC name eno16777736 to eth0 (Linux)

- How to enable Software Collections (SCL) on CentOS (Server)

- CentOS / Linux install VNC Server (Linux)

  grep search from files and display the file name
  Add Date : 2018-11-21      
  How do I search from several files (grep), and displays only the file name to match the file?

When you search from more than one file, it displays the default file name:

grep "word" filename
grep root / etc / *
Sample output:

/etc/bash.bashrc:See"man sudo_root "for details.
/ Etc / crontab: 17 **** root cd / && run-parts --report /etc/cron.hourly
/ Etc / crontab: 256 *** root test-x / usr / sbin / anacron || (cd / && run-parts --report /etc/cron.daily)
/ Etc / crontab: 476 ** 7 root test-x / usr / sbin / anacron || (cd / && run-parts --report /etc/cron.weekly)
/ Etc / crontab: 5261 ** root test-x / usr / sbin / anacron || (cd / && run-parts --report /etc/cron.monthly)
/ Etc / group: root: x: 0:
grep: / etc / gshadow: Permission denied
/etc/logrotate.conf: create 0664 root utmp
/etc/logrotate.conf: create 0660 root utmp
Each line starting with the first part of the file name (eg: / etc / crontab, / etc / group). Use the -l option to display only the file name:

grep-l "string" filename
grep-l root / etc / *
Sample output:

/ Etc / aliases
grep: /etc/at.deny: Permission denied
/ Etc / bash_completion
/ Etc / crontab
/ Etc / group
You can also reverse the output; using the -L option to output the name of a file that does not match:

grep-L "word" filename
grep-L root / etc / *
Sample output:

/ Etc / apm
/ Etc / apparmor
/ Etc / apport
/ Etc / apt
/ Etc / avahi
/ Etc / bluetooth
/ Etc / bonobo-activation
- Use preseed script to install Ubuntu 14.04 (Linux)
- System-level alias vs Oracle ADR functionality (Database)
- ORA-00824: can not set sga_target due to existing problem-solving (Database)
- A summary of Java multi-threaded programming - acquaintance multithreading (Programming)
- Tomcat itself through simple movement separation (Server)
- Linux Systems Getting Started Learning: Configuration PCI passthrough on a virtual machine (Linux)
- Install KVM on Ubuntu and build a virtual environment (Linux)
- To set up the printer use Nagios Monitoring Server (Server)
- Linux file system data file deletion problem space is not freed (Database)
- C # socket udp broadcast (Programming)
- Use DB2 federated access Oracle (Database)
- PostgreSQL transaction model introduction (Database)
- Ubuntu and Archlinux install Notepadqq 0.50.2 (Linux)
- CentOS 6.5 / Linux restart network card being given Determining if ip address x.x.x.x is already in use (Linux)
- The istgt PSD on ported to Mac OS X (Linux)
- ARM constant expression (Programming)
- Ubuntu 14.04 running ASP.NET Configuration Mono + Jexus (Server)
- SQL Server memory Misunderstanding (Database)
- To solve the Mac in question invalid BASH under configuration environment variable (Linux)
- Zabbix Agent for Linux Installation and Configuration (Server)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.