Quantcast
Channel: User Kramer - Unix & Linux Stack Exchange
Browsing all 24 articles
Browse latest View live

Comment by Kramer on Sed replace not functioning as expected

sorry, I corrected, from single to double quote enclosing, David is right :)

View Article



Comment by Kramer on single text file on require multiple operations using a...

with a combination of sed and awk you can complete most of this, as roaima said, what have you tried so far?

View Article

Comment by Kramer on How to write a shell script to change folder permisison

small tip use dos2unix command to convert the return method from Win to Lnx next time :)

View Article

Comment by Kramer on How can I add the bin subdirectory of the specific...

well, that depends on how you installed the software, if you are using a CentOS/RHEL/Fedora like distribution you could do the following 1. get the pacakge name yum list ${search_string}\* please note...

View Article

Comment by Kramer on Secure Linux to use in workplace

take into account your statement departs from the premise that Amin Vakil (the user) will be the only holder for the root password. Anyway, an encrypted HD should not be decriptable without the...

View Article


Comment by Kramer on How do I share my Windows Music Library with my Linux...

well, you will need a Widget or something to do that in Nautilus I guess; I am not very familiar with it as I use plain bash and XFCE. But yes, you will be able to access the filesystem containing your...

View Article

Comment by Kramer on Modification required for the perl command

you could combine the solution from @choroba with mine, read the FS using perl, then apply for each of the found results the commands I shared with you :)

View Article

Comment by Kramer on Modification required for the perl command

I found this for the file size: perlmaven.com/how-to-get-the-size-of-a-file-in-perl

View Article


Comment by Kramer on Mapping a word "foo" to a domain name "foobar.com"

I would recommend to keep concepts separated, a bash alias vs a vhost alias :)

View Article


Comment by Kramer on Mapping a word "foo" to a domain name "foobar.com"

use a server alias then, should be the easiest. I would avoid using bash/cli aliases in this case, the result could be very unexpected, otherwise the hosts file is your best bet from my POV

View Article

Comment by Kramer on Connect to Windows shared folder via GUI application?

the problem might be in the mount point ownership, the GUI aplication may be accessed as user, and where you are mounting the folder, may be owned by root. can you ls -lah the folder where you are...

View Article

Comment by Kramer on Print specific range of lines between two matches...

given his statement: How can I print all data between two matches, staring from specific line after the first match. and his expected output, I wanted to make it simple. I guess your assumption...

View Article

Answer by Kramer for Adding time stamp to a log file?

add this following or preceding your line `date "+%Y-%m-%d"` e.g. 2016-04-26 in your code printf "this is the output\t`date "+%Y-%m-%d"`" will read as: this is the output 2016-04-26 you can use this...

View Article


Answer by Kramer for Samba Permissions in Linux

Actually I would add some more info. Samba ignores the UMASK set in the system for any user hence you may need to configure Samba to use a specific UMASK. As example you will need to use these config...

View Article

Answer by Kramer for Error installing PHP7.1 with apache2 on debian 9

use Sury repo for this (https://deb.sury.org/), this is a small script to add it to your repo list. #!/bin/bash # To add this repository please do: if [ "$(whoami)" != "root" ]; then SUDO=sudo fi...

View Article


Answer by Kramer for split file into N pieces with same name but different...

Steps count the lines in file and divide by 30 lines = cat ${file} | wc -l get the amount of files you need (bash will round it up to an integer) numOfFiles = ${lines} / 30 use split to divide the file...

View Article

Answer by Kramer for Problem with 2 php version and openssl

Use alternatives for this, this way you can control and move between versions and configs as needed: https://wiki.debian.org/DebianAlternatives Once configured the change is as easy as: sudo...

View Article


Answer by Kramer for Adding crlf character in xml file

unix2dos <file> the file char method is very tricky when it comes to read config in both, UX (LF) or Windows (CRLF), even on Mac (CR) dos2unix to convert CRLF > LF unix2dos to convert LF >...

View Article

Answer by Kramer for Unable to install phpmyadmin

First of all, the error you are getting is because some script is trying to execute mysql with no password as root: either you are root or you are using sudo: ERROR 1045 (28000): Access denied for user...

View Article

Answer by Kramer for Find command output to sort and then delete

well, sorting requires a logic around it but so far: # Create an array with the files you want to target FILES=$(find ${PATH_TO_FOLDER} -type f -name "whatever.whatever") # Get the total size of the...

View Article
Browsing all 24 articles
Browse latest View live




Latest Images