Search for files in a directory hierarchy
find
cd /usr
find -name bash
find -name bash*
find -name bin
A file can be copied from another location to the current directory
Example:
1. Create “somefile” in /tmp and copy to your current directory
cp /tmp/somefile
cp /bin/bash /tmp
Find files by name
locate
The ____ command uses the updatedb database to find files or directories on the entire system
locate
locate gnome-terminal
locate vim
locate ifconfig
locate -i sudo
CREATING TEXT FILES -VIM
cd /tmp vim lbookfile1.txt Press A Type some words Esc to get out Insert Mode Press : to enter command mode w to save file wq to save and quit vim
CREATING TEXT FILES -EMACS
cd /tmp emacs -nw lbooktest3.txt type a few lines Ctrl C and then ctrl S Ctrl H for help Ctrl x
Determine file type
file
A binary file is what the computer “reads” (e.g. vim is a binary file)
cd /tmp
ls > temp.txt
file temp.txt
file /bin/bash