Linux

Linux - Watch Movies in ASCII Text Mode With mplayer

Other than showing off a cool trick, I can't think of a legitimate reason to do this. But for those interested, you'll need mplayer installed to play a video in ASCII text mode. If you don't already have it installed, run the following command to install it:

Ubuntu: sudo apt-get install mplayer

openSUSE (If you haven't added the packman repositories, you'll have to do that first here):

sudo zypper install mplayer

If you are looking for a video to test this out on, check out the trailer for Big Buck Bunny. You can download it by running the following command:

wget http://mirror.cessen.com/blender.org/peach/trailer/trailer_400p.ogg

To play the video in ASCII Text mode, run the following command:

mplayer -vo caca trailer_400p.ogg

Linux - Watch Movies in ASCII Text Mode With mplayer 1

Linux - Watch Movies in ASCII Text Mode With mplayer 2

Linux - History Command Tutorial - How to Run Previous Commands and Clear History

The history command is very useful for people who use the command line. If you haven't used it before, now is a great time to make it a habit, as it can save you time.

The history command by itself will provide a numbered list of previously executed commands:

history - tutorial run previous commands 1

To execute one of the previously ran commands, use the exclamation mark followed by the number of the command (no spaces):

!3

history - tutorial run previous commands 2

To clear the history, run the following command:

history -c

history - tutorial run previous commands 3

To simply run the last ran command again, run the following command:

!!

Hope this helps some of you become more proficient in the command line!

Linux - Change to Home Directory From the Command Line Terminal

A lot of people don't know you can do this, or don't know how. Obviously to change directories you use the cd command. To change to your home directory, run the following command:

cd ~

Change_to_home_directory_linux_terminal

You can also use this method to reference files or folders in your home folder. For example:

cat ~/Documents/send-connector.txt

is the same thing as this:

cat /home/user/Documents/send-connector.txt

Ubuntu Linux - How to Find IP Address from Terminal and GUI

Finding your local LAN ip address in Ubuntu Linux is very easy. There are 2 ways to find it, from the command line or from the GUI.

Command Line:

Just open the terminal and run this command: ifconfig

Ubuntu Linux - Find IP Address 1

 

GUI:

Right click on the Network Manger icon in the top right corner and click on "Connection Information". You will then see a window displaying your ip address and other useful network information:

Ubuntu Linux - Find IP Address 2

Ubuntu Linux - Find IP Address 3

Ubuntu Linux - How to Restart or Reboot System from Command Line Terminal

 

Restarting or rebooting an Ubuntu Linux computer or server from the command line is very simple. Just run the following command:
 
sudo reboot
 

Ubuntu Linux - How to Shutdown System from Command Line Terminal

Shutting down an Ubuntu Linux computer or server from the command line is very simple. Just run the following command:

sudo shutdown -P 0

-P means 'Power Off' and 0 is the number of seconds to wait before powering off.

How to Get and Download all File Type Links from a Web Page - Linux

This tutorial explains how to take a URL and get all of the links for a specific file type (pdf, jpg, mp3, wav, whatever extension you want) exported into a list and download all of the links in Linux. In my example, I have a web page with over 20 links to pdf files. Instead of downloading them individually and manually, this script will allow me to download all of them at one time, and give me a list of each link.

You need to have lynx and wget installed before running this script. To install, run the following command:

Ubuntu: sudo apt-get install lynx-cur wget

openSUSE: sudo zypper install lynx wget

Save the following text as link-dl.sh and execute it by running "sh link-dl.sh":

 

#! /bin/bash
lynx --dump http://www.appassure.com/resources/technical-documentation/ | awk '/http/{print $2}' | grep pdf > /tmp/file.txt
for i in $( cat /tmp/file.txt ); do wget $i; done

Linux - How to Find the Hostname

Finding the hostname in Linux is very simple and basic. The method is the same, regardless of your Linux distribution (Ubuntu, openSUSE, Fedora...) Here are 2 ways to find the hostname:

Run the command "hostname":

hostname

Read the contents of "/etc/hostname":

cat /etc/hostname

Linux - How to Find Kernel Version from Terminal

To find out the Linux kernel version in use on a Linux system (should work on any Linux distribution, including Ubuntu, openSUSE, Fedora, or whatever), just run the following command:

uname -r

uname -r

Ubuntu - How to View or Show Hidden Files in Nautilus or Terminal - Linux

By default, Ubuntu hides hidden files and folders. If you want to view them, you can do it from the file browser Nautilus or from the command line terminal. Here is how:

File Browser Nautilus:

While you have the file browser open, just hit "Ctrl + h". That will allow you to view the hidden files and folders.

Terminal:

The "ls" command will only display files and directories that aren't hidden unless you supply the -a switch. "ls -a" will show you all files and directories, including hidden ones.

Pages

Subscribe to Linux