Tag Info

New answers tagged

1

No need to chroot first, you can just mount your / and then copy the file over. Make sure the owner UID / GID are the same. Open terminal and run this command: sudo cp /home/ubuntu/org.gnome.settings-daemon.plugins.media-keys.gschema.xml /mnt/usr/share/glib-2.0/schemas/ assuming /mnt is where you mounted your original /.


-4

Run chmod 777 gradlew in the directory that contains gradlew


2

If you haven't made any significant modifications, copying the skeleton bashrc is enough. It doesn't affect the boot or GUI login process.


1

To access a directory having space in between the name use \<space> to access it. You can also use Tab button to auto completion of name. For example : guru@guru-Aspire-5738:~$ cd /media/Data/My\ Data/ guru@guru-Aspire-5738:/media/Data/My Data$. `


0

There are two ways a MIME type and a .desktop file are associated. Method 1 The first way is through *.list MIME config files (many exist on the system, see below). For example, a typical entry in ~/.local/share/applications/mimeapps.list might be: [Default Applications] application/x-bittorrent=transmission.desktop;deluge.desktop This means that the ...


5

To make a single duplicate of a file you probably know that you can use cp: cp file file-001 Now, to make more duplicates to a file, you can combine cp with xargs. In your case: echo file-{001..200} | xargs -n 1 cp file will copy file to file-001, file-002,... ,file-200. See man xargs for more info.


4

As always, the python truck comes late, but: make it executable, drag it over a terminal window, drag the file to copy over the terminal window and set the number of copies: script file number_ofcopies The number of leading zeros is set automatically, the files are named file_001.pdf, file_002.pdf, with the filenumbers placed before the extension. The ...


15

You could do something like < file tee file-{001..200} however if the medium becomes unreadable it will not matter how many copies are on it - fundamentally backups require diversity. Note that tee writes its standard input to standard output as well as to each of the given files - for large files, or for files containing binary data or other special ...


15

This is the classic case where shell tricks help a lot. for i in {000..199}; do cp file file-$i; done And I know it's a joke, but if you want a random _ or - separating the number from the name you can use: for i in {000..199}; do cp file file$(cat /dev/urandom | tr -dc '_-' | fold -w 1 | head -n 1 )$i; done (multiple line to help ...


0

A small python script to replace the file extension recursively in given directory. The script skips hidden files. Paste it into an empty file, make it executable and run it by the command: /path/to/script [directory_with_files_to_rename] [new_extension] (use extension including the dot) The script: #!/usr/bin/env python3 import os import shutil ...


1

It is true that you won't use system memory but the fact you don't use cpu in your exemple is only because you don't read the pipe so the process is waiting. Consider this exemple : $ mkfifo /tmp/testpipe $ tar cvf - / | gzip > /tmp/testpipe Now open a new console and run this : $ watch -n 1 'ps u -P $(pidof tar) Open a third console and type : $ ...


0

Try with this one: sed -e :a -e '/$/N; s/\n/ /; ta' test.txt -e : It allows to write a sed program in several parts. For example, a sed program with two substitution rules could be written as sed -e 's/one/two/' -e 's/three/four' instead of sed 's/one/two/;s/three/four'. It makes it more readable. In this one-liner the first -e creates a label called a. ...


1

GEDIT: Search and replace \n with a space ' '. You can get the replace window by going to 'Search'->'Replace' or via the keybpard shortcut Ctrl+H See screenshot below: Your original text is on lines 1-14. The result is on line 16.


0

If it were me I'd just open it in vim and press Shift+J a few times.


0

Try this sed -e :a -e '/$/N; s/\n/\\n/; ta' [filename] http://anandsekar.github.io/joining-all-lines-in-a-file-using-sed/


0

I hope the following could help. .ts files are recognized by the system but can be played on your linux box, you have to right-click with the mouse on your file , and then select open with .... (do not forget to mark remember selection so the system can remember to associate your file with the app you will select which in our case is Smplayer) Or you can ...


1

Assuming you have a folder that contains only project folders, you could run the following in that folder: for proj in *; do phpfiles=$(find $proj -iname '*.php') size=$(du -ch $phpfiles | tail -n 1 | cut -d\t -f1) echo $proj $size done Explanation: we iterate over all project folders. In each folder, we find all *.php files. We compute the total ...


0

No problem: find /var/www/site/ -type f -name "*.php" -exec du -shc {} + | tail -1 | awk '{print $1}' You can script this to make it show them all: #!/bin/bash cd /var/www/ for i in $(find ./* -maxdepth 0 -type d) do prjSz=$(find $i -type f -name "*.php" -exec du -shc {} + | tail -1 | awk '{print $1}') echo "${i:2}: $prjSz" done


1

. refers to the current location, and .. refers to the parent directory. The 8 is 8K. Try using ls -alh.


1

In order, '.' is the current directory, and '..' is the parent of the current directory. typing cd .. will move you up the directory tree one level.


0

You can still use Beyond Compare on Linux, they have a linux port. Go to http://www.scootersoftware.com/download.php and download one of the debian packages.


0

fldiff might be what you search. It's in the offical repositories. Install it with: sudo apt-get install fldiff Another one is diffuse: sudo apt-get install diffuse


1

There is this script sec.Bluetooth.SendFile.NautilusScript.sh You have to copy it to ~/.gnome2/nautilus-scripts/ And may need to install its latest dependencies too.


2

Of course, if you create a hard link to a file, then both the original file and the hard link point to the same inode. In fact, both are equivalent - for the system there is no such thing as "the original" and "the link". They are simply two access points to the same inode. Consequently, they take up no more space together than if you had only one access ...


1

You can use dd to create a file consisting solely of zeros. Example: dd if=/dev/zero of=zeros.img count=1 bs=1 seek=$((10 * 1024 * 1024 * 1024 - 1)) This is very fast because only one byte is really written to the physical disc. However, some file systems do not support this. If you want to create a file containing pseudo-random contents, run: dd ...


0

Using dd, this should create a 10 GB file filled with random data: dd if=/dev/urandom of=test1 bs=1M count=10240 count is in megabytes. Source: stackoverflow - How to create a file with a given size in Linux?


2

Sure, you can read it without doing any harm. It's a binary file - if you are interested in the text in it, like program symbols, messages, or version numbers, use strings: strings /sbin/init | less /lib64/ld-linux-x86-64.so.2 I*|YB GU1q nx#$ BDCE #9ym libnih.so.1 _ITM_deregisterTMCloneTable __gmon_start__ _Jv_RegisterClasses _ITM_registerTMCloneTable ...


0

I never quite figured out what the deal was with this. I re-installed the OS and setup my ufw rules like I did before. I've been monitoring the before and after rules and the issue has not replicated.


5

Yes. It's safe to view any system file(s), especially if you don't use sudo or root. prakhar@aS4v4g3wOrld:~$ ll /sbin/init -rwxr-xr-x 1 root root 265848 Jul 18 15:16 /sbin/init* The owner of /sbin/init is root. The only way you can modify this file is either via logging as root ($ sudo -s) or by giving an editor superuser permissions using sudo. Besides, ...


0

You can view but you can't make changes. Do not save on exit init. copy the file first with cp /sbin/init /sbin/init.me then run sudo nano /sbin/init.me Here you first make a copy of the original file (init.me) then you take a look at init.me and find out what you are searching for.


0

Yep, it is fine to just view. Make sure when you click close, you don't save any changes you accidentally made. To be super safe, run the following command: sudo cp /sbin/init /tmp/init.copy then run: sudo gedit /tmp/init.copy So you're not viewing the original.



Top 50 recent answers are included