How to find the last 10 command that you used on the command line in Linux

Type in the following command in the CLI history | tail -n 10 This command will list the last 10 command line commands that you used. Example 506 history n 507 history | tail 508 history | tail -10 509 history | tail -n 3 510 pgrep skype 511 pgrep phone 512 grep -rni 'test' *.php 513 cd /var/www/test/ 514 grep -rni 'test' *.php 515 history | tail -n 10

April 7, 2018 · 1 min · 70 words · icarnaghan

How to find the User Id for a specific user in Linux

Open a new Terminal Session if not already in the command line. Enter the following command. Replace UNAME with the name of the user. id -u UNAME This will output the User Id for the Username specified.

April 7, 2018 · 1 min · 37 words · icarnaghan

How to find what what shell you are currently using on Linux

Open a new Terminal Window Type in the following command echo $SHELL This will output something similar like below root@local-laptop:~$ echo $SHELL /bin/bash

April 7, 2018 · 1 min · 23 words · icarnaghan

How to find your uid(userid) and gid(groupid) in Linux via the command line

Open a new Terminal Window (Command Line) if in GUI mode Find your username by typing the command: whoami Type in the command id username to find your gid and uid EXAMPLE of results: uid=1000(username) gid=1000(username) groups=1000(username) ,4(adm),20(dialout),24(cdrom), 46(plugdev),106(lpadmin),121(admin),122(sambashare)

April 7, 2018 · 1 min · 39 words · icarnaghan

How to find/list all the Symbolic links on a Linux box

In the command line type in the following command: find / -type l And execute it! Now all your Symbolic Links will be listed.

April 7, 2018 · 1 min · 24 words · icarnaghan

How to fix PHP Fatal error: Class 'DOMDocument' not found in /var/www/html/index.php on line 171 or similar error

NOTE: Received this error on a Centos 5 environment while trying to run a PHP script that makes use of the DOMDocument class In the CLI (Command Line Interface) run the following command {codecitation class=“brush: shell;”} yum install php-xml {/codecitation} This will install XML support and will solve the DOMDocument issue

April 7, 2018 · 1 min · 51 words · icarnaghan

How to get a listing of emails in the email queue for Exim

Enter the following command in the command line to print a listing of the message in the queue exim -bp The output in exact order will show Time Queued, Size, Message-Id, Sender and Recipient

April 7, 2018 · 1 min · 34 words · icarnaghan

How to get information about a file such as last access, modified or changed time using Linux

NOTE: Tested and tried on Ubuntu 9.04 Answer: By using the ‘stat’ command. stat = Display file or file system status Example: Input: stat photos-20090916-0.db Output: File: `photos-20090916-0.db' Size: 3072 Blocks: 8 IO Block: 4096 regular file Device: 807h/2055d Inode: 529743 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 1000/ user) Gid: ( 1000/ user) Access: 2009-09-16 08:22:12.085106864 +0200 Modify: 2009-09-16 08:22:11.490127752 +0200 Change: 2009-09-16 08:22:11.526128486 +0200

April 7, 2018 · 1 min · 65 words · icarnaghan

How to get information about your laptop battery using the Command Line within Linux

Open a new command line window and type in the following command cat /proc/acpi/battery/BAT0/info This will display all information about your battery present: yes design capacity: 7200 mAh last full capacity: 2732 mAh battery technology: rechargeable design voltage: 11100 mV design capacity warning: 135 mAh design capacity low: 94 mAh cycle count: 0 capacity granularity 1: 41 mAh capacity granularity 2: 2597 mAh model number: GARDA43 serial number: 10102 battery type: LION OEM info: SONYCorp

April 7, 2018 · 1 min · 75 words · icarnaghan

How to get the 60GB Cell C Speed Stick MF668 working on Ubuntu 11.04

Open a new Terminal Window Type in lsusb ( lsusb is a utility for displaying information about USB buses in the system and the devices connected to them. ) A list of USB buses in the System will appear, the Cell C device will be listed as Bus 002 Device 007: ID 19d2:1224 ONDA Communication S.p.A. Install usb-modeswitch, usb-modeswitch-data and libusb-1.0-0 via the Command Line, the code below can be copied and pasted to install the three packages ...

April 7, 2018 · 2 min · 231 words · icarnaghan