I use AWS and I got an EC2 instance. When I run the command du -h –max-depth=1 I get: and When I run the command df -h I get: It look I use only 1GB but it show that I am using 7.1GB. So I run the command lsof +L1 to locate some deleted file that process are still using
How do you move files from one folder to the other?
I am trying to move specific files from one folder to another. Would the below work? Answer I think this can work:
sed fails with errors
I’m trying to replace the next string with sed in all the files in the current directory : (including apostrophe) ‘Control_Reports_Pg.C_Table_Title_Date’ with the string : timeofday()::varchar(250) I tried to escape the special characters ‘ ( ) with the command : The error I got : sed:…
Removing carriage return character ^M from output file created by python script
I have a python script that outputs file with similar text: This data is split by “” and is imported to a table in hive database. My issue that some of that data contains ^M carriage return character which splits up my data: I need to remove ^M and have my data all together. I have tried dos2unix …
Read the log files and get the entries between two dates
I want to extract some information from the access log file that matches a keyword and between two dates. For ex. I want to find log entries between two dates that contains text “passwd”. For now, I am using the following command but not getting the correct results: Date format is [22/Feb/2017:17:…
How to get local codepage in linux?
In Windows, I can use GetAPC function to get the local codepage. But how should I do to get local codepage in Linux? Thanks. Answer Linux does not use code page identifiers. It has locale identifiers, but different processes can have different locales and a process may be using different locales in different …
Problems establishing connection with DB
Platform: LINUX. I am a beginner of MongoDB and pymongo. After installing pymongo, here is a simple test I tried on ipython: At this point, it chokes. And in the end, spits out a “Error 111: connection refused” error. So, I tried invoking MongoDB straight from the terminal and I still got the erro…
Linux shell script regex match
I have a text file. I want to get lines starting with specific format. I just want to get lines that have x/x/x format. x is a number. But this regex is not working. It is always giving no match : File is : Answer Don’t use bash if you can use a better tool: But if you have to
how to handle bash with multiple arguments for multiple options
I need to download chart data from poloniex rest client with multiple options using bash only. I tried getopts but couldn’t really find a way to use mutliple options with multiple parameters. here is what I want to achieve having the arguments I need to call wget for c x p times well I am explicitly wri…
Issues importing python-pptx on Linux (Ubuntu 17)
I am trying to import the python pptx library in a python programm. I installed it using pip before, which gave me the following output: So this seems to be a success. But as I am trying to import the module using the following code: It says No module named ‘pptx’. It must have something to do wit…