How to Find Files and Folders in Linux Using the Command Line

Using the Find Command

The “find” command allows you to search for files for which you know the approximate filenames. The simplest form of the command searches for files in the current directory and recursively through its subdirectories that match the supplied search criteria. You can search for files by name, owner, group, type, permissions, date, and other criteria.

Typing the following command at the prompt lists all files found in the current directory.

find .

The dot after “find” indicates the current directory. Continue reading

Advertisements

Linux Command To Find the System Configuration And Hardware Information

On Linux based system most of the hardware information can be extracted from /proc file system, for example display CPU and Memory information, enter:

cat /proc/meminfo
cat /proc/cpuinfo

The following list summarizes commands to get various hardware from the system:

Linux cpu/hardware information

Use any one of the following command:
# less /proc/cpuinfo
OR
# lscpu
Sample outputs:

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                32
On-line CPU(s) list:   0-31
Thread(s) per core:    2
Core(s) per socket:    8
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 45
Stepping:              7
CPU MHz:               1999.874
BogoMIPS:              4000.99
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              20480K
NUMA node0 CPU(s):     0-7,16-23
NUMA node1 CPU(s):     8-15,24-31

Continue reading

How Do I Map a Drive Network Share Using the Linux Terminal?

Still getting used to Linux, and the GUI is great. I have Ubuntu 10 and I can go to Network and see the Windows network. Then double clicking this gets me to the drives that are shared. Then when I go back to the terminal and use:

cd ~/.gvfs

I can see the mapped drives. But it would be nice if I could this without all the mouse clicking. So how do I map network drives in the terminal, something akin to net use for Windows.

EDIT: Not sure what happened, but this is what I did to get it to work. I created the directory for the share in /media and then ran:

sudo mount -t cifs -o username=nicorellius //server/share/ /media/share

and it said command couldn’t be found. So i thought I would go ahead and use smbfs so I ran:

sudo apt-get install smbfs

I tried the command suggested with smbfs instead of cifs and that didn’t work either. So I tried again and then the next time I ran:

sudo mount -t cifs -o username=nicorellius //server/share/ /media/share

it worked and I could navigate to the directory with cd.