Tag: file

68 votes
3 answers
3K views
Can I hex edit a file in Visual Studio?

I want to edit a binary file, but I don't want to use another tool other than Visual Studio because it&ap

avatar
Solomon
0 1 0 9
asked 07 September, 2021
53 votes
13 answers
1.7K views
Write lines of text to a file in R

In the R scripting language, how do I write lines of text, e.g. the following two lines Hello World to a fi

avatar
Santiago
0 1 0 9
asked 07 September, 2021
55 votes
16 answers
1.9K views
How to remove a directory from git repository?

I have 2 directories on my GitHub repository. I'd like to delete one of them. How could I do that without

avatar
Venice
0 1 0 9
asked 07 September, 2021
54 votes
30 answers
481 views
Download a single folder or directory from a GitHub repo

How can I download only a specific folder or directory from a remote Git repo hosted on GitHub? Say the examp

avatar
Roger
0 1 0 9
asked 07 September, 2021
57 votes
7 answers
2.2K views
How do I make a comment in a Dockerfile?

I am writing a Dockerfile. Is there a way to make comments in this file? Does Docker have a comment option th

avatar
Jefferey
0 1 0 9
asked 07 September, 2021
44 votes
30 answers
3.1K views
denied: requested access to the resource is denied : docker

I am following this link to create my first docker Image and it went successfully and now I am trying to push

avatar
Dwain
0 1 0 9
asked 07 September, 2021
56 votes
14 answers
1.3K views
How do I pass environment variables to Docker containers?

I'm new to Docker, and it's unclear how to access an external database from a container. Is the best

avatar
Louetta
0 1 0 9
asked 07 September, 2021
61 votes
21 answers
2.9K views
Docker: Copying files from Docker container to host

I'm thinking of using Docker to build my dependencies on a Continuous Integration (CI) server, so that I

avatar
Percy
0 1 0 9
asked 07 September, 2021
57 votes
16 answers
592 views
What is the difference between the 'COPY' and 'ADD' commands in a Dockerfile?

What is the difference between the COPY and ADD commands in a Dockerfile, and when would I use one over the ot

avatar
Hallie
0 1 0 9
asked 07 September, 2021
57 votes
27 answers
1.5K views
Convert DOS line endings to Linux line endings in Vim

If I open files I created in Windows, the lines all end with ^M. How do I delete these characters all at once?

avatar
Daniel
0 1 0 9
asked 07 September, 2021
60 votes
17 answers
3.1K views
open() in Python does not create a file if it doesn't exist

What is the best way to open a file as read/write if it exists, or if it does not, then create it and open it

avatar
Benton
0 1 0 9
asked 07 September, 2021
56 votes
28 answers
2.4K views
Exploring Docker container's file system

I've noticed with docker that I need to understand what's happening inside a container or what files

avatar
Suzan
0 1 0 9
asked 07 September, 2021
61 votes
30 answers
2K views
How to get full path of a file?

Is there an easy way I can print the full path of file.txt ? file.txt = /nfs/an/disks/jj/home/dir/file.txt

avatar
Boyd
0 1 0 9
asked 07 September, 2021
65 votes
11 answers
2.6K views
Remove a symlink to a directory

I have a symlink to an important directory. I want to get rid of that symlink, while keeping the directory beh

avatar
Wei
0 1 0 9
asked 07 September, 2021
60 votes
10 answers
1.8K views
How to redirect output to a file and stdout

In bash, calling foo would display any output from that command on the stdout. Calling foo > output would

avatar
Kurtis
0 1 0 9
asked 07 September, 2021
57 votes
29 answers
2.4K views
How to find and restore a deleted file in a Git repository

Say I'm in a Git repository. I delete a file and commit that change. I continue working and make some mor

avatar
Hilario
0 1 0 9
asked 07 September, 2021
64 votes
12 answers
1.8K views
Remove a file from a Git repository without deleting it from the local filesystem

My initial commit contained some log files. I've added *log to my .gitignore, and now I want to remove th

avatar
Benton
0 1 0 9
asked 07 September, 2021
50 votes
9 answers
2.6K views
reading v 7.3 mat file in python

I am trying to read a matlab file with the following code import scipy.io mat = scipy.io.loadmat('test.m

avatar
Sena
0 1 0 9
asked 07 September, 2021
64 votes
7 answers
464 views
In MATLAB, can I have a script and a function definition in the same file?

Suppose I have a function f() and I want to use it in my_file.m, which is a script. Is it possible to have th

avatar
Jefferey
0 1 0 9
asked 07 September, 2021
56 votes
8 answers
2.2K views
How to get all files under a specific directory in MATLAB?

I need to get all those files under D:\dic and loop over them to further process individually. Does MATLAB su

avatar
Scot
0 1 0 9
asked 07 September, 2021