Quantcast
Channel: Command Line – Txt
Browsing all 19 articles
Browse latest View live

Trasfer over the network

Transfer stdin and stdout to and from machines over the network ssh remote_machine 'cat - > file'

View Article



top in Batch Mode

Run top in batch mode top -b -d 10 -n 3

View Article

Command to Find Current Ubuntu Version

Run this command to find the installed version of Ubuntu… cat /etc/lsb-release

View Article

Watch for Ubuntu 9.10 Launch

This script will run check for ubuntu launch once every 5 mins and let you know if there is an launch. while [ 1 ]; do if [ -z "`curl -I "http://cdimage.ubuntu.com/releases/9.10/release/"|grep "404"`"...

View Article

Generate Password

Command to generate a random password… openssl rand -base64 6

View Article


Send Text Once Every 15 Mins

Command to send a text to any phone once every 15 mins. while [ 1 ]; do sms NUMBER_GOES_HERE "$(date '+%I:%M %p') Hey Anju. Still awake?"; sleep 15m; done Script calls the command ‘sms’ – you can...

View Article

Send One Line From a Text File as as SMS Every 10 Mins

This command will send a line from a given text file one every 10 mins as an SMS to a given number. i=1; while [ 1 ]; do sms INSERT_PHONE_NUMBER "$(cat "/home/binnyva/sms.txt"|head -n$i|tail -n1)";...

View Article

Convert RAW files to JPEG

Convert RAW files to JPEG in batch. Convert all files in a folder using a command. For this to work, first you must have ‘ufraw’ package installed. sudo apt-get install ufraw or sudo yum install ufraw...

View Article


Iterate a Text File in Bash

This is how you iterate thru a text file outputting a line at a time in Bash shell scripting. IFS=$'\n'; for i in $(cat FILE.TXT); do echo "$i"; done

View Article


Compress the Big Files

Compress the big image files for i in $(find . -size +1M); do convert -resize 40% -quality 80 $i $i; done

View Article

Encrypt/Decrypt files using GPG

Encrypt/Decript files in linux #Encypt... gpg -c <Source File> #Decrypt... gpg <Encrypted File>

View Article

Search Wikipedia from Command Line

Get the intro paragraph of any wikipedia article using this trick… dig +short txt "<keyword>".wp.dg.cx

View Article

Database Data to Download Variables

Gets data from a MySql database, splits the data into separate columns, then uses one column in a URL to download something – and uses other column to name the file thats downloaded for i in $(mysql -u...

View Article


Rename Images Based on Exif Date

Renames all the files in the current folder based on the Exif date of that image. You’ll need the ‘jhead’ command tool – use apt-get to install it. for i in *; do mv $i "$(jhead $i | grep date | sed...

View Article

Remote Port Forwarding using SSH Tunnel

If you want someone on the internet to access a service/port on your local system(and you have access to a remote server), you can use SSH Tunnel to do this. Step 1: Configure the Remote Server Edit...

View Article


Install and Configure Docker

Install Docker Source Run these commands on your ubuntu system to install Docker. sudo apt update sudo apt install apt-transport-https ca-certificates curl software-properties-common curl -fsSL...

View Article

Screen Mirroring from Android phone to Linux

Use scrcpy(screen copy) to mirror an Android device – and see/use it from your linux system. Setup Install scrcpy… sudo apt-get install scrcpy Connect your phone to your system using a USB cable. Make...

View Article


Pass Command Line Arguments to npm

If you want to pass command line arguments to npm scripts, use the -- separator. Example… npm run build -- --prefix-paths This will pass the --prefix-pathsto the build script. Please note the double --...

View Article

Run Webserver with current folder as root

Different ways to run a webserver using the current directory as root. Useful to serve static files. If you use NPM, install serve using npm install serve -g. Then run it using the command… serve If...

View Article
Browsing all 19 articles
Browse latest View live




Latest Images