Tag Info

New answers tagged

0

The file libGL.so is in various different packages. Depending on your graphic card choose one of them: package-name: fglrx fglrx-updates nvidia-173 nvidia-304-updates nvidia-304 nvidia-331-updates Install them with: sudo apt-get install <package-name>


0

There are many tools to install packages in Ubuntu, some of these tools are GUI (such as Ubuntu Software Center - Synaptic - etc ...) while others still CLI if you like the command line mode(such as apt-get , dpkg , aptitude ...). The most known command to install a package is sudo apt-get install package-name So all of what you want to do is to insert ...


2

You can create a hex-dump of your file with xxd which is part of the vim-common package. xxd file.csv | less Then check the line endings: 0a => \n 0d => \r 0d0a => \r\n


-1

****i want to create single jpg to multiple .. and every jpg have different name..name ill provide**** example .. image.name.jpg image.1.jpg image.2.jpg image.3.jpg image.a.jpg image.b.jpg image.c.jpg ... please help me .. am stuck on this step how can i do ..


1

You can use the file to give you an indication of the type of line endings. Unix: $ file file1.txt file1.txt: ASCII text DOS: $ file file2.txt file2.txt: ASCII text, with CRLF line terminators and knowing that DOS uses carriage return and line feed ("\r\n") as a line ending, which Unix uses just line feed ("\n"). So you can determine what is EOL of ...


0

The question has already been answered, so I won't be repetitive. However, I would like to point out that there are numerous such shortcuts in various shells that help repeat/find/edit commands. Some of the ones that I use are: !$ followed by will type the last word of the last command. For example, ls -l /let/me/in cd !$ This will land you in ...


1

I don't know about efficient, but sed with a regular expression. Make a backup of the file in case you make a typo, but perhaps something like this: sed -i 's/"\([0-9]\+\)_\([0-9]\+\)"/\1\2/g' bigcsvfile.csv


0

The two top-scoring answers, nmcli dev list iface <interfacename> | grep IP4 and nm-tool both assume that network-manager is in control. Which it is - on desktop machines most of the time at least. But the fuller answer is that sometimes network-manager is not in control. E.g. vpnc messes with /etc/resolv.conf directly. So: First check if ...


0

Depends. I don't recall if ubuntu uses busybox, if so, your commands are those available in busybox. To see a list, type this: busybox --list Or busybox -h Beyond that, available programs are determined by your PATH environment variable. Generally, these are the same as those in the terminal. Any executable that is in your PATH will be available as ...


1

Sounds like you're missing a desktop manager to start X. LightDM is the most common these days. Easy to install: sudo apt install lightdm Then you can reboot (and it'll load up automatically) or you can start it there and then if it doesn't already do this after install: sudo service lightdm start


0

The typical route to starting X from the command line (TTY) is to use .xinitrc and/or startx. First, find out which command starts the Pantheon session. Look in /usr/share/xsessions for a .desktop file named after Pantheon, and check the Exec line in that file: $ grep Exec -R /usr/share/xsessions/pantheon.desktop Exec=gnome-session --session=pantheon ...


0

Using python: #!/usr/bin/env python2 import glob, os for filename in glob.glob('*.jpeg'): first = filename.split('.') second = first[0].split() name = '' for i in range(0, len(second)): name += second[i][:2] os.rename(filename, name + '.' + first[1] first is the list containing the parts of filename splitted on the . (assuming ...


0

I have not tried this before, but this page says you can send binary via minicom by encoding it in ASCII. You need to have busybox installed on the box. Use uuencode to encode. Here is it's syntax: uuencode [INFILE] STORED_FILENAME > send_file INFILE is the path to file to encode and STORED_FILENAME is obviously the name of the file. uuencode outputs ...


4

You can do this using a single rename command (i.e. you don't need a bash script for this, or you can use this command within your bash script in place of the for loop): rename -n 's/(^| )([^ ]{1,2})[^ ]*/$2/g; s/$/.mp4/' *.mp4 This will just mimic the behavior of echo mv [...], so that you can see the result without actually renaming anything. If the ...


0

You should consider using Aria2 and the Web GUI instead of utorrent because utorrent are not trustworthy especially considering they tried to sneak in cryptomining with your computer, meaning they waste your resources and your power to make themselves money. - http://torrentfreak.com/utorrent-quietly-installs-riskware-bitcoin-miner-users-report-150306/ ...


0

I don't know anything about mac, but in your ubuntu server you can enable forward X session. Afterwards you can run a graphical application on your server and relay the application window directly to your ssh client. I can describe the procedure for ubuntu serer AND client. Server: /etc/ssh/sshd_config *find line X11Forwarding and set it to yes* NOTE ...


1

Here is a lazy man's script to get the job done (considering only one instance of process is running): #!/bin/bash while [ -h /proc/"$(pgrep apt-get)"/exe ]; do sleep 10 done echo "DONE" Replace echo "DONE" with what you want to do next. You can run it as a cron job. Every process has a directory in /proc assigned with their PID, the full path to ...


-2

As described its the previous command, but its better not to use this as its a sloppy short hand. Being more direct is simple and safer. $ vim index.php The program 'vim' is currently not installed. You can install it by typing: sudo apt-get install cowsay $ sudo apt-get install !! # Would be done as sudo apt-get install vim index.php instead of sudo ...


4

You can use a for loop, so the command is executed for every file exactly once: for file in *.dat; do sed -i.bak '1,2000d' "$file"; done Notice, -i.bak backs up the original file with .bak ending.


2

Neither of these suggestions may work for you, but here's what I would try first: Regarding the first issue, there's a hidden file in your home folder called .bashrc. Open a terminal and type ls -a which means "list files -all of them" and you should see the file. The contents of this file are executed every time you open your terminal, and I suspect that ...


1

The following command works for me: qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause


1

You can accomplish this with some udev rules, as @Rinzwind suggested. First, save your script to somewhere accessible by other users. For example, you could save it as /usr/local/bin/script.sh. Now, make the script accessible by others. sudo chmod 555 /usr/local/bin/script.sh Now, plug in your USB modem and then run lsusb. Below is an example output: $ ...


1

There's also a simple command to use, for example in your Home Dir. we have a folder "Xtest" which contains test.tar.gz and test.txt, test2.txt etc. and an empty folder "Xtest2" where we want to move all files except .tar.gz then: cd ~/Xtest mv !(test.tar.gz) ~/Xtest2 All the content except test.tar.gz will be moved to Xtest2 folder.


1

Use the good old find: find /usr/src -maxdepth 1 -type f -name "Comix*[^\.tar\.bz2]" -print0 | xargs -I{} -0 mv {} /usr/share/icons/


2

You can use the GLOBIGNORE variable of bash: GLOBIGNORE=ComixCursors-0.8.2.tar.bz2 Now run: mv ComixCursors* /usr/share/icons/ Also note that when you are done with the operation it is good to unset the variable to avoid unwanted scenarios: unset GLOBIGNORE Or GLOBIGNORE=


6

Here are a few ways: grep. There are various regular expressions that will pick these up. Here, I am looking for 5 repetitions of 2 letters or numbers followed by a colon, then any two characters. The -i makes the match case insensitive and the -o makes grep print only the matched portion. -E enables extended regular expressions. The same regex also works ...


0

This question deserves a new answer. If correctly installed, just type nodejs --version or node --version to check the version. If you need a newer and well maintained repository A good option is to use NodeSource repositories, that are very well mantained. Follow these steps (note the new setup script name for Node.js v0.12) curl -sL ...


15

You can access the address file for each device on the /sys virtual filesystem. The MAC address should be in /sys/class/net/<device-name>/address: $ cat /sys/class/net/enp1s0/address 34:17:eb:5d:88:7c For all devices: $ cat /sys/class/net/*/address 34:17:eb:5d:88:7c 00:00:00:00:00:00 64:5a:04:69:50:45


0

This happens because the program that reads the user input can't handle special characters. The terminal is in raw mode. If the program is a script you can use read -e to use the Bash readline function that can handle special characters.


15

The easiest way would be to use grep with PCRE: $ ifconfig -a | grep -Po 'HWaddr \K.*$' 74:d4:35:84:34:13 grep -P will enable us to use perl compatible Regex grep -o will only take the matched portion of the line We have matched HWaddr before our desired match (MAC addresses) and then discard HWaddr by \K to print only the MAC addresses. @Helio has ...


2

ifconfig -a | grep HWaddr | awk '{print $5}' If your system output is non-English in this command, then it makes sense to run it this way. LANG=C ifconfig -a | grep HWaddr | awk '{print $5}' This is applicable to all solutions.


1

Nautilus does not have a command line option to open a new tab, however, you can "fake" it with the help of a script, using xdotool and wmctrl. How to use Install (if necessary) both wmctrl and xdotool: sudo apt-get install xdotool wmctrl Copy the script below into an empty file, save it as nautilus_tab (no extension) in ~/bin, and make it executable. ...


0

If with vcf files you mean vCard files, the resulting file works with OS X's Address Book. My guess is that it should work with any application. If you do it with cat *.vcf > all.vcf, you will not overwrite your original files.


9

Always when you have such a question in mind, ie, you don't know the name of the tool to invoke it in command line, find it from the terminal itself: man -k <keyword> It will search manpages for the keyword you specified and prints the titles. In your case, it would be: man -k calculator As an illustration, if you want to invoke the webcam tool ...


2

The command is gnome-calculator


3

Try to type: gnome-calculator Or for Older version (Ubuntu 12.04 and before): gcalctool


0

To see what processes are running on a machine, you can use ps. This is a command with a huge number of options, so you might want to take a look at man ps to learn a little about it. To check whether anyone is running watch, you would do: $ ps aux | grep -w watch terdon 15915 0.0 0.0 15912 2676 pts/4 S+ 15:58 0:00 watch ls terdon 16123 ...


0

Since you asked for a Vim, here is the command to run: sudo vim -e +'$put = \"<Directory \\"/var/www/*\\">\n\tOrder allow,deny\n\tAllow from all\n\tAllowOverride All\n</Directory>\n\"' -cwq /etc/apache2/apache2.conf If you don't have vim, this is also equivalent to either vi -e or ex. Alternative cleaner approach: $ sudo ex +"r /dev/stdin" ...


0

If you mean how to add a command so you can just run it in a terminal without mentioning full path of the program. Copy it to /usr/local/bin (system level) or only in ~/bin/(user level) and make sure that its executable. Make sure the file name is the command you want to run.


1

To remove then change a single field we can use this command: root@kurawa:~# exiftool -Copyright= IMG_3357.jpg root@kurawa:~# exiftool -Copyright=LinuxSlaves IMG_3357.jpg Reference: http://www.linuxslaves.com/2015/05/view-and-manipulate-exif-metadata-image.html


1

Here is a script that will check to see if it is after 17:00 then perform a task of turning the backlight on. #!/bin/bash time=$(date +%k%M) if [[ "$time" -ge 1700 ]];then echo "Backlight on" xset led 3 else echo "Backlight off" xset -led 3 fi On a 24 hour clock, midnight 0:00 would be less than 17:00 so it would then become false and not ...


0

TestDisk Is powerful data recovery software, primarily designed to help recover lost partitions. To install it: Open a terminal,Press Ctrl+Alt+T And run: sudo -i apt-get update apt-get install testdisk hfsutils hfsplus hfsprogs How to run Step by Step


4

You need to give the increment as negative number i.e. in your case -1. For example: $ seq 1 5 && seq 5 -1 1 1 2 3 4 5 5 4 3 2 1 Here seq 5 -1 1 takes the format seq FIRST INCREMENT LAST. Furthermore, if you want every alternate numbers from 10 to 0: $ seq 10 -2 0 10 8 6 4 2 0 Check man seq to get more idea.


37

!! has nothing to do with apt-get. It is a shell keyword that will be expanded to the previous command. This expansion is done by shell before the current command is interpreted. From man bash: !! Refer to the previous command. This is a synonym for `!-1'. For example, if you run a command: echo "foo" Then if you run: sudo apt-get install ...


16

!! : Refer to the previous command. This is a synonym for !-1 (The source). For instance, if i execute: ./test then remember that I need to be Root, then I could simply type: sudo !! it's the same as typing: sudo ./test It's useful when your last command contain a lot of characters.


65

!! is a shortcut in bash that means last command executed. Try this: echo hello !! In this context, the !! will be expanded to another echo hello. I imagine what happened was they tried to run a command and it failed and complained it wasn't installed. So then they typed sudo apt-get install !! because the package name was coincidentally the same as ...


2

You could easily solve this by adding /sbin to $PATH. The more important point is that, you should not have /sbin in the path by default. See this page for a description of why: /sbin directory definition /sbin contains system utilities that should be run by root or using sudo authority. So if you want to see your network configuration simply type: sudo ...


2

Under Edit -> Profile preferences is where it should be. Maybe you didn't notice the checkbox? Untick the Use the system fixed width font and you can change the size:


0

Thank you, all, I found a working solution. I use only one version of perl. I use a default perl installation on a default Ubuntu 14.04 LTS installation, with defaults tools bash and gedit. Using bare 'myscript.pl' on the cmd line I got weird 'no such file','command not found' or 'cannot execute binary file...' messages. Using chmod u=x, I changed the x ...


6

Use a shell glob instead of ls: select option in "Exit" "$1"/* . . . elif [ -n "$option" ]; then ls "$option" else . . .



Top 50 recent answers are included