Tag Info

Hot answers tagged

5

arp manipulates the entries in the kernel ARP cache, you are probably going to get a lot of entries (depends on the size of the LAN). As you are only interested in the IP addresses you should use the -n option so that arp shows numeric addresses instead of hostnames first. Also you will typically get a lot of IP addresses depending the size of your LAN, so ...


5

Here is another idea using awk arp -ni eth0 | awk 'NR>1 {print $1}' Example $ arp -ni eth0 | awk 'NR>1 {print $1}' 192.168.20.3 192.168.20.1 192.168.20.11 or with a variable $ addresses=$(arp -ni eth0 | awk 'NR>1 {print $1}') $ echo $addresses 192.168.20.3 192.168.20.1 192.168.20.11 To get a specific index without an array $ arp -ni eth0 ...


3

When you run a command in bash via -c option, a non-interactive shell is spawned. The ~/.bashrc file is sourced for non-login interactive shells (and also for login interactive shells, sourced from ~/.profile). The main point is interactivity. The ~/.bashrc file has the following snippet at the start : case $- in *i*) ;; *) return;; esac This ...


2

Actually all these PPAs are from third parties. Oracle does not provide any PPA, and the manual way of installing Oracle JDK 8 is explained in step by step manner in this article : Install Latest Oracle JDK in Ubuntu Step 1: Download the latest JDK(jdk-Xuxx-linux-xXX.tar.gz) from this official link. Step 2: Open the terminal (Ctrl + Alt + T) and enter the ...


1

The /etc/environment update will only work on the next session, it's not automatically reloaded. Which means you cannot change it for sessions that have already started for other users. If you want to "reload" whatever is in the /etc/environment you need the following command: source /etc/environment But again it will only work for your own current ...


1

In bash you can set variables like this: export JAVA_HOME=/usr/lib/jvm/java-8-oracle/​ export CLASSPATH=JAVA_HOME/lib/:$CLASSPATH export PATH=$JAVA_HOME/bin/:$PATH export M2_HOME=/usr/share/maven/ export M2=$M2_HOME/bin export PATH=$M2:$PATH for more info on environment variables you can read https://help.ubuntu.com/community/EnvironmentVariables


1

Create a script with the name export_flags #!/bin/bash srt_file_name="${1%\.*}".srt if [ -f "$srt_file_name" ]; then FLAGS="-i $srt_file_name -sub_charenc CP1252 -vcodec copy -acodec copy" else FLAGS="" fi export FLAGS="$FLAGS" Make it executable chmod +x export_flags Start a test with source export_flags your_mkv echo $FLAGS E.G. ...



Only top voted, non community-wiki answers of a minimum length are eligible